New to Python.
Sean Ross
sross at connectmail.carleton.ca
Thu Mar 18 00:10:52 EST 2004
More information about the Python-list mailing list
Thu Mar 18 00:10:52 EST 2004
- Previous message (by thread): New to Python.
- Next message (by thread): New to Python.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Sean Ross" <sross at connectmail.carleton.ca> wrote in message news:m3a6c.19554$E71.1405188 at news20.bellglobal.com... [snip] > # otherwise, you can go line by line > source = file('C:\Python23\Samples\Bob.txt') > tally = 0 > for line in source: > if "customer" in line: > tally += 1 > source.close() > [snip] # sorry, that should be source = file('C:\Python23\Samples\Bob.txt') tally = 0 for line in source: tally += line.count("customer") source.close()
- Previous message (by thread): New to Python.
- Next message (by thread): New to Python.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list