Обновить u8/program.py
This commit is contained in:
parent
6de31fff55
commit
23ab4d8df0
@ -45,4 +45,28 @@ answers = rows[pos + 1:]
|
|||||||
print("Pocet otazok:", question_count)
|
print("Pocet otazok:", question_count)
|
||||||
print("Pocet odpovedi:", answer_count)
|
print("Pocet odpovedi:", answer_count)
|
||||||
print("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.")
|
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")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user