Python code | Sololearn: Learn to code for FREE!
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.

10th Aug 2022, 1:49 AM
Saurabh Kumar
Saurabh Kumar - avatar
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
10th Aug 2022, 2:38 AM
Manas Dixit
Manas Dixit - avatar