On 8/25/05, Frank Hoffsümmer <[EMAIL PROTECTED]> wrote:
> 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.

What version of python are you using? This was introduced in Python 2.3.

ActivePython 2.4.1 Build 245 (ActiveState Corp.) based on
Python 2.4.1 (#65, Mar 30 2005, 09:33:37) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 'bar' in 'foobarbaz'
True

-- 
John.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to