Computer Science, asked by TeeshaAhuja, 11 months ago

write the output of the following:
string="Hello Madam,I love Tutorials"
substring=''Madam"
if string.find(substring) !=–1:
print ("Python found the substring!")
else:
print ("Python did NOT find the substring!")​

Answers

Answered by ankita369591
3

Answer:

Python found the substring!

Explanation:

string.find(substring) returns -1 when substring is not found.

in given example substring is found so it

will return the lowest index of the substring which is not equal to -1

therefore the if condition is true and produces "python found substring" as the output

Similar questions