+ 2

Why this code is not working?

text = input("") word = input("") def search(text, word): if word in text: print('Word found') else: print('Word not found') print(search(text, word)) # this is the code of the last project in python for bigenners course. # why it is showing none after the result? The description of the projectšŸ‘‡ #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

19th Jun 2022, 4:29 AM
Dhrubak
4 Answers
+ 1
Dhrubak Don't print function because you have already printed value inside function
19th Jun 2022, 4:31 AM
AĶ¢J
AĶ¢J - avatar
+ 3
AJ, Thanks a lot bro..
19th Jun 2022, 4:32 AM
Dhrubak
+ 1
Dhrubak If you don't return anything inside function then function will return None.
19th Jun 2022, 4:32 AM
AĶ¢J
AĶ¢J - avatar
+ 1
text = text.split():
20th Jun 2022, 5:49 AM
EmmzyCodez
EmmzyCodez - avatar