Search engine | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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