Is a character inside a string : String In « String « Python






Is a character inside a string

Is a character inside a string
 

myjob = "hacker"

print "k" in myjob                   # 1 means true (found)
print "z" in myjob                   # 0 means false (not found)

           
         
  








Related examples in the same category

1.Step through String ItemsStep through String Items
2.Demonstrates the len() function and the in operator