From 23ab4d8df07918c1db65b621e4109e4bad39a18c Mon Sep 17 00:00:00 2001 From: Arina Dohadailo Date: Thu, 5 Nov 2026 23:43:13 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20u8/program.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- u8/program.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/u8/program.py b/u8/program.py index e5d5cff..8ad37d1 100644 --- a/u8/program.py +++ b/u8/program.py @@ -45,4 +45,28 @@ answers = rows[pos + 1:] print("Pocet otazok:", question_count) print("Pocet odpovedi:", answer_count) print("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.") +current = tree +print(current[0]) + +step = 0 + +while len(current) > 1: + if step == len(answers): + print("Koniec vstupu") + exit() + + choice = answers[step] + step += 1 + + if choice == "a": + current = current[1] + elif choice == "n": + current = current[2] + else: + print("Nerozumiem") + exit() + + print(current[0]) + +print("Koniec")