finding an element in a string

Jerry Hill malaclypse2 at gmail.com
Mon Jun 25 17:18:57 EDT 2007


On 6/25/07, Miguel Oliveira <blewguy at hotmail.com> wrote:
> I was looking for a way for the program to respond "good" to any sentence
> that would contain the word "fine" in it.

This will work for any string with the string "fine" in it.

if "fine" in x:
    print "Good."

-- 
Jerry



More information about the Python-list mailing list