+ 1

How to make search engine using python vide

Search Engine 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 Define the search() function, so that the given code works as expected.

13th Apr 2021, 8:47 AM
Jay Bhamare
Jay Bhamare - avatar
5 Answers
+ 7
# Search engine text = input() a = text.split() word = input() def search(): if word in text: print("Word found") else: print("Word not found") search()
27th Jun 2021, 5:31 AM
Jay Bhamare
Jay Bhamare - avatar
+ 2
text = str(input()) word = str(input()) def search(text,word): text = text.split(' ') if word in text: return("Word found") else: return("Word not found") print(search(text,word)) very good thx
17th Dec 2021, 9:36 PM
Atlas Tiger
Atlas Tiger - avatar
0
Jay Bhamare Show your attempts
13th Apr 2021, 9:18 AM
A͢J
A͢J - avatar
0
or we can do it b using for loop text = str(input()) word = str(input()) def search(text, word): for i in text: if word in text: return("Word found") else: return("Word not found") break search(text, word)
6th Dec 2022, 10:52 AM
Muhammad Ghufran
Muhammad Ghufran - avatar
0
# Search engine text = input() a = text.split() word = input() def search(): if word in text: print("Word found") else: print("Word not found") search()
11th Oct 2023, 9:43 AM
Tiger Muthuvel Pandian fa fa fa fa fa
Tiger Muthuvel Pandian fa fa fa fa fa - avatar