summaryrefslogtreecommitdiff
path: root/comp/work/21/results.py
diff options
context:
space:
mode:
authorstandenboy <standenboy@StandenboyLAP.lan>2024-01-25 10:57:10 +0000
committerstandenboy <standenboy@StandenboyLAP.lan>2024-01-25 10:57:10 +0000
commiteb1a5582181bf3188f30d665a295321d36bdc795 (patch)
tree01c10676436a51a03fa53519fe8572f5d31abb1c /comp/work/21/results.py
parent9e83a3046472e598be3f5a9b7d104f97a97ff36a (diff)
did the cover work
Diffstat (limited to 'comp/work/21/results.py')
-rw-r--r--comp/work/21/results.py22
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])