Question: [EC1-8] ( strip_comments.py ) Write a program that reads a string fname from the user, then opens the file fname.py (Python source) with that name.
[EC1-8] (strip_comments.py) Write a program that reads a string fname from the user, then opens the file fname.py (Python source) with that name. Copy each of its lines into a new file named 'strip_' + fname.py, deleting all Python comments as you go. Recall these begin with a # anywhere on a line and continue to the end of the line. Your output .py file should still be a valid program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
