Mar-14-2021, 03:15 PM
Your code as currently written is looking at the list variable
I'm not 100% sure of your expectations, but it sounds like maybe you want to search
string1
, which you have explicitly defined, to see if it contains either text
or word
. So, you are only going to get the "Word found" output if you enter "This is awesome" or "awesome", since those are the two values found in string1
.I'm not 100% sure of your expectations, but it sounds like maybe you want to search
text
to see if it contains word
. You can do that by changing the first line of your search function.