0
How this variable declaration and if statement works?
text = input() word = input() def search(text, word): search = word and text if word in text == search: return "Word found" else: return "Word not found" print(search(text,word)) https://code.sololearn.com/cS932OrcaT03/?ref=app
2 Answers
+ 2
There is unnecessary extra variable using 'search'.
Remove it. It will be clear code.
+ 1
Also, you have a function and a variable with the same name: "search". Always use unique names.