Guys please help me l want to create the search engine in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Guys please help me l want to create the search engine in python

I have to enter a text then find the word in the text there shld be use of if statements

3rd Jun 2022, 4:56 PM
Thandolwenkosi
7 Answers
+ 7
Qhufu , i do not agree with your comment about giving a complete code. at the time when i give the op my support, he has already posted his code, and after this i have given my comments and a slightly reworked version of his code. but i totally agree with you, that we should not give a complete code unless the op has posted a serious attempt.
4th Jun 2022, 1:30 PM
Lothar
Lothar - avatar
+ 5
Thandolwenkosi , this is your code slightly modified so that it is working. see also the comments and hints #text=input() # these 3 lines should be placed after the function. #word=input() # print(search(text,word)) def search (txt, wrd): # we need to take the arguments from the function call and store them in variables if wrd in txt: # was: if search in txt: #not correct return("Word found") else: return ("Word not found") text=input() word=input() print(search(text,word)) # need to have no indentation here
3rd Jun 2022, 5:34 PM
Lothar
Lothar - avatar
+ 1
Show us ur try so we can help u
3rd Jun 2022, 4:59 PM
Khentit Nadji Sabri
+ 1
text=input() word=input() print(search(text,word)) def search (): if search in text: return("Word found") else: return ("Word not found") Thus my trial
3rd Jun 2022, 5:04 PM
Thandolwenkosi
+ 1
Hi! You can take a look at this one: https://code.sololearn.com/cUfknSL2J4by/?ref=app
3rd Jun 2022, 5:24 PM
Per Bratthammar
Per Bratthammar - avatar
+ 1
Thank u so much guys may the Good Lord bless you
30th Jun 2022, 1:51 PM
Thandolwenkosi
0
/* name - "Slim", type - "Giraffe", country_id - 1 */ INSERT INTO animals(name,type,country_id) values('Slim' , 'Girafee' , 1); SELECT animals.name,animals.type,animals.country_id,countries.id,countries.country FROM animals,countries; FROM animals INNER JOIN countries ON animals.country_id=countries.country ORDER BY country ; Guys please help the above is my code on SQL l was given two tables one of the tables l was suppose to a some elements then join them using a INNER JOIN but am not getting the desired solution so plz help
30th Jun 2022, 4:06 PM
Thandolwenkosi