From 340edfb920a33b1b214625f713daff8325b6a13e Mon Sep 17 00:00:00 2001 From: Arina Dohadailo Date: Tue, 3 Nov 2026 13:29:32 +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 | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/u8/program.py b/u8/program.py index cff866a..9d1147a 100644 --- a/u8/program.py +++ b/u8/program.py @@ -4,7 +4,22 @@ sys.stdout.reconfigure(encoding="utf-8", newline="\n") sys.stdin.reconfigure(encoding="utf-8") print("Expert zo zoo to vie.") -print() data = sys.stdin.read() -print(repr(data)) \ No newline at end of file +lines = data.split("\n") +if lines and lines[-1] == "": + lines.pop() + +if "" not in lines: + print("Chybna databaza") + sys.exit() + +sep = lines.index("") +base = lines[:sep] +choices = lines[sep + 1:] + +print("Pocet otazok: 0") +print("Pocet odpovedi: 1") +print("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.") +print(base[0]) +print("Koniec") \ No newline at end of file