+ 1

Hey guys, can someone tell whats wrong in my code? Why is it outputting 'non' at the end?

text = input() word = input() def search(text,word): if word in text: print("Word found") else: print("Word not found") print(search(text,word))

11th Apr 2022, 4:39 PM
Liwaa Bou Hamdan
Liwaa Bou Hamdan - avatar
1 Resposta
+ 7
Just use search(text, word) instead of print(search(text, word)) Your function not returning anything so defaultly it return none.
11th Apr 2022, 4:41 PM
Jayakrishna 🇮🇳