Question: Python Help: Writing a program to read from one file line by line and number it in a new file I'm writing this program and

 Python Help: Writing a program to read from one file line

Python Help: Writing a program to read from one file line by line and number it in a new file

I'm writing this program and I found this to work for what I want. However what does the "while line:" on line 11 do. How is the "line" variable changed so that it's not an infinite loop. I know it has to do with the line=f1.readline() on line 13. But how is that line any different than the one in line 7. Also how does it know to read the next line in the inputFile?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!