PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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
#CODE :-
def search(txt,wrd):
for i in txt.split(" "):
if i == str(wrd):
return "Word found"
else:
return "Word not found"
text = input()
word = input()
print(search(text, word))
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run