def file_count(fname):
with open(fname) as f:
for i, 1 in enumerate(f):
paas
return i+1
print(“Total number of lines in the text file: ”, file_count(“file.txt”))