Issue
I’m working with Python v2, and I’m trying to find out if you can tell if a word is in a string.
I have found some information about identifying if the word is in the string – using .find, but is there a way to do an IF statement. I would like to have something like the following:
if string.find(word):
print("success")
Thanks for any help.
Solution
What is wrong with:
if word in mystring:
print('success')
Answered By – fabrizioM
Answer Checked By – Jay B. (BugsFixing Admin)