New to Python.

Kirk Strauser kirk at strauser.com
Thu Mar 18 05:15:09 CET 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 2004-03-18T03:07:05Z, droog <droog at orange.gov> writes:

> 	if line.find('customer'):

Note that this method, when fixed, will only count the number of lines where
'customer' occurs, regardless of the number of times it can be found on each
line.

A (slightly) more accurate counter would be:


   counter += line.count('customer')

- -- 
Kirk Strauser
The Strauser Group
Open. Solutions. Simple.
http://www.strausergroup.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAWSGH5sRg+Y0CpvERArAWAJ96IrqOogdFTqPLdi8wtnkAlq3l2QCgiXfg
HF+aWKda8pQjtx/1tGA0QMo=
=JBnU
-----END PGP SIGNATURE-----



More information about the Python-list mailing list