Aktualizovat u8/program.py

This commit is contained in:
Oleksandr Mateshchuk 2026-11-03 13:25:31 +00:00
parent d4e786127d
commit 5689284c77

View File

@ -27,6 +27,31 @@ def main():
root = create_tree(lines, index, counts) root = create_tree(lines, index, counts)
print(f"Pocet otazok: {counts[0]}")
print(f"Pocet odpovedi: {counts[1]}")
print("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.")
print()
current = root
while current.text.endswith("?"):
print(current.text)
try:
answer = input()
except EOFError:
print("Koniec vstupu")
return
if answer == "a":
current = current.yes
elif answer == "n":
current = current.no
else:
print("Nerozumiem")
return
print(current.text)
print("Koniec")
if __name__ == "__main__": if __name__ == "__main__":
main() main()