Search engine | Sololearn: Learn to code for FREE!

+1

Search engine

hello guys i'm about to finish my beginners python course i'm stuck here for several minutes this my code so far text = input() word = input() def search (text,Word): if word in text: print ("Word found") else : print ("Word not found") print(search(text, word)) please help me

4/15/2021 9:28:11 PM

raunaq.khanija

9 Answers

New Answer

+2

🙄🙄

+1

word=input() text=input() def search (text,word): text=text.split(' ') if word in text: return "Word found" else : return "Word not found" print(search(text, word))

+1

Make sure it’s not your code, but your upper and lower cases. print(“Word found”) else: print(Word not found”) search(text,word) If you have lower case w’s, it will reject your answer. I over looked it at first!

0

What is the problom here?

0

i've taken screenshot of test area here it is https://gyazo.com/1f75370fbd8f1259289be84c35813e58

0

Try taking the second print statement in the else section

0

i fixed the typo still no luck here

0

Put in this for it text = input() word = input() if word in text: print ("Word found") else : print ("Word not found")

0

Maybe split your text into a list of words and use that? I think `x in string` only works for a single char x.