0

Python разве не должен быть вывод ??? почему нет вывода print(" is а mango seller!")

graph = {} graph["you"] = ["alice", "ЬоЬ", "claire"] graph["bob"] = ["anuj", ] graph["alice"] = ["peggy"] graph["claire"] = ["thom", "jonny"] graph["anuj"] = [] graph["peggy"] = [] graph["thom"] = [] graph["jonny"] = [] from collections import deque def search(name): search_queue = deque() search_queue += graph[name] searched = [] while search_queue: person = search_queue.popleft() if not person in searched: if person == "bob": print(" is а mango seller!") return True else: search_queue += graph[person] searched.append(person) return False

20th Apr 2022, 8:56 PM
Tedi
Tedi - avatar
1 Réponse
+ 1
You never call search. Вы никогда не звоните в поиск.
20th Apr 2022, 9:30 PM
John Wells
John Wells - avatar