New course! Every coder should learn Generative AI!
Try a free lesson0
What's wrong with my code?
text = input() word = input() def search(text, word): if word in text: print("Word found") else: print("Word not found") print(search(text, word))
1 Answer
+ 5
A) print inside the function and remove the print() when you call the function
B) replace the print() inside the function with return
Make sure you understand the difference between print() and return when writing functions