Computers and Technology

Write a function called strip_comments that takes as parameters a source file name (string, e. g. a python file), a destination file name (string), and a comment prefix (string) and that removes all comments that start with the prefix string from the first source file and writes the resulting content to the second file whose name is given. for python, the prefix is "#", for c/c++ it could be "//". if a comment starts at the beginning of a line then the entire line is removed from the resulting file. a comment in python and many other languages continues from the prefix string to the end f the line. example: suppose file test2.py has this content:

answer
Answers: 1

Similar questions

Do you know the correct answer?
Write a function called strip_comments that takes as parameters a source file name (string, e. g. a...

Questions in other subjects:

Konu
Business, 28.09.2019 11:50
Konu
Mathematics, 28.09.2019 11:50
Konu
Computers and Technology, 28.09.2019 11:50