I had coded a simple python program for substring comparison but it is giving me wrong answer
, it should print the match is found
after matching
def myfirst_yoursecond(p,q):
a = p.find(" ")
c = p[:a]
print "the first word is:",c
##Storing the other "bell" word of "p" string in c
a1 = q.find(" ")
c1 = q[a1+1:]
print "The second word is:",c1
## Storing the other "bell" word of "q" string in c1
## comparing the string
if ( c is c1 ) :
print "the match is found"
else:
print "not found"
## function call
myfirst_yoursecond("bell hooks","curer bell");