why not "'in' in 'in'"?
Mark McEahern
marklists at mceahern.com
Thu Jun 13 10:24:22 EDT 2002
I haven't followed this thread. Someone else has probably already suggested
this, but in case they haven't, it's fairly easy to define your own function
that does what you want:
def is_in(search, search_for):
"""Return bool indicating whether search_for is in search."""
return search.find(search_for) >= 0
subject = "i like spam, i do."
x = "spam"
y = "ham"
print is_in(subject, x)
print is_in(subject, y)
// m
-
More information about the Python-list
mailing list