How to make search engine using python vide | Sololearn: Learn to code for FREE!


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.

4/13/2021 8:47:01 AM

Jay Bhamare

4 Answers

New Answer


# Search engine text = input() a = text.split() word = input() def search(): if word in text: print("Word found") else: print("Word not found") search()


Hint: use the for loop and also use split method


Try it in this way 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))


Jay Bhamare Show your attempts