0
What is wrong in this code ?
This is last practice test of phython beginners level.I am getting the right answer but with word ‘none’ Please tell me how to fix this. text = input().split() word = input() def search(text,word): if word in text: print("Word found") elif word not in text: print("Word not found") print(search(text,word))
5 ответов
0
def search(text,word):
if word in text:
print("Word found")
else:
print("Word not found")
return ""
text = input()
word = input()
print(search(text, word))
0
Eashan morajkar, i used return but the code is still returnind word ’none’.
0
You want the function to return the string. Change it so you return "Word not found" or "Word Found". Make sure you use if word in text. Crazy you're still stuck on this? I completed the entire python for beginners course in the time since you asked this question and managed to solve it.
0
Idk it is showing none with word found
0
Did you remove .split as well?