Aktualizovat u8/program.py
This commit is contained in:
parent
d4e786127d
commit
5689284c77
@ -27,6 +27,31 @@ def main():
|
||||
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__":
|
||||
main()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user