Custom Search

Sunday, January 2, 2011

python if in operation with string

python "if in" operation with string

>>> name = 'smithjohnannaivan'
>>>
>>> if 'john' in name:
...     print '---ok-----'
...
---ok-----
>>>

No comments:

Post a Comment