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.
4 Réponses
+ 2
Use an if-else statement. You can use the "in" keyword to check if a string contains a substring
+ 2
You need to call the function
search(text, word)
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")
0
Wow I'm idiot, thank you!