diff options
Diffstat (limited to 'comp/work/21/results.py')
-rw-r--r-- | comp/work/21/results.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/comp/work/21/results.py b/comp/work/21/results.py new file mode 100644 index 0000000..bfd2d2f --- /dev/null +++ b/comp/work/21/results.py @@ -0,0 +1,22 @@ +results = [] + +more = "yes" + +while more.lower() == "yes": + result = 0 + tmp = [] + while True: + result = int(input("result: ")) + if result == -1: + break + if result < 0: + print("invalid input") + elif result > 100: + print("invalid input") + else: + tmp.append(result) + results.append(tmp) + more = input("add results for another student? ") + +for i in range(len(results)): + print("student",i+1,"got: ", *results[i]) |