New course! Every coder should learn Generative AI!
Try a free lesson- 1
Python code
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.
1 Answer
+ 1
def search(t,w):
for i in t:
If i == t:
print(“word found”)
else:
print(“not found”)
text = input()
Word = input().split()
#python