Fixes in With line number

Fixes:
- Change the variable name from "input" to "file". "input" is built-in function, this action overrides it.
- Fix space between "i" variable and "line" variable in for loop
This commit is contained in:
Matheus Felipe authored and GitHub committed 2022-02-06 18:01:33 -03:00
1 parent 9b952384a5
commit e2aee30178
1 file changed
+2 -2
+2 -2
View File
@@ -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))
```