Okay I've been having some problems with my code, it's a simple python search engine whereby the user inputs a sentence and a word. If the word is in the sentence then the code is to output "word found" and if the word is not found then it is supposed to print "word not found".
Here is my code:
text = input()
word = input()
def wrong(text, word):
print("Word not found")
wrong(text, word)
def right(text, word):
print("Word found")
right(text, word)
def check(right, wrong):
if text.index == word:
return right
elif text.index != word:
return wrong
check(right, wrong)
So instead what I've been getting as output is both the responses instead of just one. Please help me.