demoFile=open("lambpoem.txt","r")
for i in demoFile:
print(i)
how do I modify the code in order for it to include the line number before the text in that line?
The way that I do this but this is certainly not the only way would to do so.
with open('File.txt', 'r') as f:
files = f.readlines()
for i in range(len(files)):
print(i, files[i])