Fix9u8
This commit is contained in:
parent
f7c7332938
commit
2c4c96e838
@ -8,7 +8,7 @@ def main():
|
||||
q = pocet_otazok(tree_lines)
|
||||
a = pocet_odpovedi(tree_lines)
|
||||
tree = build_tree(tree_lines)
|
||||
if tree is None or len(tree) == 0:
|
||||
if tree is None or len(tree_lines) != 0:
|
||||
print("Chybna databaza")
|
||||
return
|
||||
print("Pocet otazok:", q)
|
||||
@ -43,6 +43,8 @@ def build_tree(tree_lines):
|
||||
if line.endswith("?"):
|
||||
node["a"] = build_tree(tree_lines)
|
||||
node["n"] = build_tree(tree_lines)
|
||||
if node["a"] is None or node["n"] is None:
|
||||
return None
|
||||
return node
|
||||
|
||||
def pocet_otazok(tree_lines):
|
||||
@ -66,7 +68,7 @@ def read_tree_lines():
|
||||
tree_lines.append(text)
|
||||
text = input().rstrip("\r")
|
||||
except EOFError:
|
||||
pass
|
||||
return None
|
||||
return tree_lines
|
||||
|
||||
def controla_batabaz(tree_lines):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user