Line counting in Python : <p>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? </p>

<p>Many thanks all</p>

<pre><code>fhand=open('test.txt')
count=0
for line in fhand:
    count=count+1

print count
</code></pre>
