Fix1u8
This commit is contained in:
parent
6e7b2c2d2f
commit
84c4658045
@ -18,25 +18,28 @@ def pocet_odpovedi(tree_lines):
|
||||
|
||||
|
||||
def main():
|
||||
data = sys.stdin.read()
|
||||
raw_lines = data.split("\n")
|
||||
|
||||
lines = [] #чистимо рядочки від \r
|
||||
for l in raw_lines:
|
||||
clean_line = l.rstrip("\r")
|
||||
lines.append(clean_line)
|
||||
|
||||
tree_lines = []
|
||||
for line in lines:
|
||||
if line == "":
|
||||
break
|
||||
tree_lines.append(line)
|
||||
|
||||
print("Expert zo zoo to vie.")
|
||||
tree_lines = read_tree_lines()
|
||||
if tree_lines is None or len(tree_lines) == 0:
|
||||
print("Chybna databaza")
|
||||
return
|
||||
print("Pocet otazok:", pocet_otazok(tree_lines))
|
||||
print("Pocet odpovedi:", pocet_odpovedi(tree_lines))
|
||||
print("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.")
|
||||
print(tree_lines[0])
|
||||
print("Koniec")
|
||||
|
||||
|
||||
def read_tree_lines():
|
||||
tree_lines = []
|
||||
try:
|
||||
text = input().rstrip("\r")
|
||||
while text:
|
||||
tree_lines.append(text)
|
||||
text = input().rstrip("\r")
|
||||
except EOFError:
|
||||
return None # нема порожнього роздільника
|
||||
return tree_lines
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Reference in New Issue
Block a user