New course! Every coder should learn Generative AI!
Try a free lesson4 Answers
+ 3
shahrzad ,
we may help you, if you can give us some more information. it sounds like a tutorial exercise.
> please mention the tutorial name and exercise number.
> please also include a link to your code.
+ 2
Hi! Please, show us your code here. And then we can help you.
+ 1
Hi! Here is the question:
You’re working on a search engine. Watch your back Google!
The given code takes a text and a word as input and passes them to a function called search().
The search() function should return "Word found" if the word is present in the text, or "Word not found", if it’s not.
And my code which im not sure its correct :
text = input()
word = input()
def search(x,y):
x.split(" ")
y=str
if y==x:
print("Word found")
else :
print("Word not found")
print(search(text, word))
+ 1
move else to the left so that it is clearly in the same even vertical line with if. and remove the print command in last line. call the function by its name. no print. your program will be launched. and read carefully lesson 31.1 python for beginners