finding one string in other string in python

>>> str1 = "deepak"
>>> str2 = "hai, my name is deepak"
>>> if str1 in str2
SyntaxError: invalid syntax
>>> if str1 in str2:
    print "yes"

   
yes
>>>

No comments:

Post a Comment