0
Chapter 6
My instructor told me I was missing something in this: I modified it. I saved the text file as exercise63.txt. Now this is what I have but I get syntax errors on the if line. def main(): lineNbr = 0 infile = open('Exercise63.txt', 'r') for lineNbr in range(5) : lineNbr = lineNbr + 1 line = infile.readline() line = line.rstrip('\n') If line = 0 print(lineNbr,':',line) infile.close() #----------------- main()
2 Answers
+ 2
You forgot to add ":" at the end of if statement.
If line = 0:
+ 1
Kindly share your code here.