Newbie Question

BartlebyScrivener rpdooling at gmail.com
Tue Jun 20 03:35:09 CEST 2006


Saint Malo wrote:
> If the program searches for blue, i just want it to print blue

Huh? Tell it to print whatever you want.

for line in file:
    if 'blue' in line:
        print 'blue'

for line in file:
    if 'brown' in line:
        print 'brown'

for line in file:
    if 'red' in line:
        print 'weasels rip my flesh'




More information about the Python-list mailing list