I\'m using a for loop to read a file, but I only want to read specific lines, say line #26 and #30. Is there any built-in feature to achieve this?
Thanks
Reading from specific line:
n = 4 # for reading from 5th line with open("write.txt",'r') as t: for i,line in enumerate(t): if i >= n: # i == n-1 for nth line print(line)