I am a beginner in Python self studying Python 2.7. May I ask one question I got in line counting codes in Python? How do I intuitively understand why the below works, especially how I can understand what the for loop is doing with the file handle?
Many thanks all
fhand=open('test.txt')
count=0
for line in fhand:
count=count+1
print count