New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Python for Beginners, Code Project 45 Question.
Hello everyone! I’m trying to solve the code project 45 in Python for beginners, and here’s what I have so far: def search(t, w): if w in t: print("Word found") else: print("Word not found") text = input() word = input() print(search(text, word)) Can someone help me understand what I’m doing wrong?
2 Answers
+ 6
Remove print word and instead of that write return keyword.
Because calling functions are used to return the value to the called function. There it is used to print the resulted value.
Try it once again
Best of luck 👍
+ 3
Never mind! I got it. Thanks!