New to Python

Quin quindennis at grandecom.net
Tue Feb 9 16:00:47 EST 2010


s = f.readline()
if 'mystring' in s: print 'foundit'
if 'mystring' not in s: print 'not found'
if 'mystring' in s:
    print 'processing'

this generates output:
not found
processing

so, it doesn't find the substring, but goes into processing code anyway.

This is using IronPython



More information about the Python-list mailing list