Search engine | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

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

15th Apr 2021, 9:28 PM
raunaq.khanija
9 Answers
+ 3
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))
16th Apr 2021, 12:04 AM
Amir
Amir - avatar
+ 3
🙄🙄
7th Sep 2021, 3:59 PM
Shanto bhowmik
Shanto bhowmik - avatar
+ 1
i've taken screenshot of test area here it is https://gyazo.com/1f75370fbd8f1259289be84c35813e58
15th Apr 2021, 9:38 PM
raunaq.khanija
+ 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!
16th Aug 2021, 1:17 AM
Jesse Milletary
Jesse Milletary - avatar
0
What is the problom here?
15th Apr 2021, 9:34 PM
Random Nameless Coder
Random Nameless Coder - avatar
0
Try taking the second print statement in the else section
15th Apr 2021, 9:40 PM
Random Nameless Coder
Random Nameless Coder - avatar
0
i fixed the typo still no luck here
15th Apr 2021, 9:42 PM
raunaq.khanija
0
Put in this for it text = input() word = input() if word in text: print ("Word found") else : print ("Word not found")
15th Apr 2021, 9:54 PM
Random Nameless Coder
Random Nameless Coder - avatar
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.
15th Apr 2021, 11:36 PM
Myk Dowling
Myk Dowling - avatar