To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / python-intro.py @ 1:d6b2e34ab8c0

History | View | Annotate | Download (173 Bytes)

1
source = open('data.txt', 'r')
2
number = 0
3

    
4
# count number of data records
5
for line in source:
6
    number = number + 1
7
source.close()
8

    
9
print "Total number of lines:", number