Question: In Python 3: Open a python file and write to a new file with line numbers and a file extension of .txt. So if you
In Python 3:
Open a python file and write to a new file with line numbers and a file extension of .txt. So if you read in a file that contains:
Two roads diverged in a yellow wood, And sorry I could not travel both And be one traveler, long I stood And looked down one as far as I could To where it bent in the undergrowth
It would be saved to a second file as:
1. Two roads diverged in a yellow wood, 2. And sorry I could not travel both 3. And be one traveler, long I stood 4. And looked down one as far as I could 5. To where it bent in the undergrowth
Use any numbering look you want, for example: 1) 2) or #1 #2 or another look of your choice.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
