0
Python
Please I need help with this 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.
7 Respuestas
+ 4
We are supposed to test of the input word is in the input text.
Your if-statement doesn't make much sense.
The output strings need to match the ones in the task description.
+ 3
Please show your code so we can help you to find out what doesn't work!
+ 2
Berve01 ,
as your profile shows, you have not really started a python course yet. since we need to learn the basics of python first, it is recommended to start with the tutorial *python for beginners*. without this basics, we will struggle frequently in our learning process.
happy coding and good progress!
+ 2
The Python for Beginners course is not listed on your profile, so we can't know.
Read the task description carefully, put your code in a script on sololearn playground and share the link if you still need help
+ 1
I won't spoil you the answer, but you need to declare your "search" function first.
def search(word, text):
# your code
Then call it with the user's inputs as arguments.
0
Lisa
text = input()
word = input()
search = ("text", "word")
if ("text", "word") in search:
print ("word found")
else:
print ("word not found")