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

Search engine

I am stuck on the search engine project at the end of Python for beginners. Can anyone help me by explaining it? Thanks

10th Sep 2021, 11:45 AM
MajesticPlatypus
MajesticPlatypus - avatar
6 Answers
+ 2
MajesticPlatypus Other form: text = input() word = input() def search(a, b): if b in a: return "Word found" else: return "Word not found" print(search(text, word)) 😁😁
11th Sep 2021, 3:37 PM
CGO!
CGO! - avatar
+ 1
post all the information of it here
10th Sep 2021, 12:22 PM
Slick
Slick - avatar
+ 1
Thanks! I did it!
10th Sep 2021, 2:28 PM
MajesticPlatypus
MajesticPlatypus - avatar
+ 1
text = input() word = input() def search(): if word in text: print('Word found') else: print('Word not found') search()
10th Sep 2021, 2:30 PM
MajesticPlatypus
MajesticPlatypus - avatar
0
You’re working on a search engine. Watch your back Google! The given code takes a text and a word as input and passes them to a function called search(). The search() function should return "Word found" if the word is present in the text, or "Word not found", if it’s not. Sample Input "This is awesome" "awesome" Sample Output Word found
10th Sep 2021, 1:12 PM
MajesticPlatypus
MajesticPlatypus - avatar
0
Use the 'in' operator. As in: if <blah> in <blah>: do stuff MajesticPlatypus Nice!
10th Sep 2021, 1:14 PM
Slick
Slick - avatar