0

I don't know how to do the task "Search Engine"

This is the task: 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.

8th Nov 2021, 5:26 PM
TheWildJumper
TheWildJumper - avatar
4 Respostas
+ 2
Use an if-else statement. You can use the "in" keyword to check if a string contains a substring
8th Nov 2021, 5:46 PM
Lisa
Lisa - avatar
+ 2
You need to call the function search(text, word)
8th Nov 2021, 6:07 PM
Lisa
Lisa - avatar
0
I tried this and it didnt work text = input() word = input() def search(text, word): if word in text: print("Word found") else: print("Word not found")
8th Nov 2021, 6:05 PM
TheWildJumper
TheWildJumper - avatar
0
Wow I'm idiot, thank you!
8th Nov 2021, 6:09 PM
TheWildJumper
TheWildJumper - avatar