diff --git a/python.md b/python.md index cd1faef..8ab16bb 100644 --- a/python.md +++ b/python.md @@ -983,8 +983,8 @@ with open("myfile.txt") as file: ``` #### With line number ```python -input = open('myfile.txt', 'r') -for i,line in enumerate(input, start=1): +file = open('myfile.txt', 'r') +for i, line in enumerate(file, start=1): print("Number %s: %s" % (i, line)) ```