Hello,
I would like to check if a certain word exists in a given string.  
since I learned to love lists, I used

if myword in mystring:

...didnt work. I have now resorted to

if mystring.find(myword) >1:

is this really the canonical way to check if myword exists in mystring?
it feels somewhat "unpythonic", thats why I'm asking

thanks for any insight you might have
-frank
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to