Search Engine: Lesson 45, I try call function split_compare() but...., help please, thanks | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

Search Engine: Lesson 45, I try call function split_compare() but...., help please, thanks

text = input() word = input() def split_compare(a, b): w_a = b.split(" ") for i in w_a: if i != a: return False elif i == a: return True else: return "It's broken" def search(t, w): t_l = t.lower() w_l = w.lower() if split_compare(t_l, w_l): # calling function not working? return "Word found" else: return "Word not found" print(search(text, word)) # result always "Word not found"

6th Apr 2022, 6:20 AM
Chung
3 Réponses
+ 3
Change if i != a to if i not in a
6th Apr 2022, 6:42 AM
Ion Kare
Ion Kare - avatar
0
I want to try child helper function to explore python format code
6th Apr 2022, 6:47 AM
Chung
0
it's worked as expected thanks really
6th Apr 2022, 6:50 AM
Chung