You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
226 B
Python
6 lines
226 B
Python
5 years ago
|
def file_lengthy(fname):
|
||
|
with open(fname) as f:
|
||
|
for i, l in enumerate(f):
|
||
|
pass
|
||
|
return i + 1
|
||
|
print("Number of lines in the file: ",file_lengthy("test.txt"))
|