From 4a95719d58a708ad55b1389631d6339047f786a0 Mon Sep 17 00:00:00 2001 From: standenboy Date: Fri, 15 Dec 2023 10:19:20 +0000 Subject: added existing work --- comp/work/9/scores.py | 21 +++++++++++++++++++++ comp/work/9/tanks.py | 10 ++++++++++ 2 files changed, 31 insertions(+) create mode 100755 comp/work/9/scores.py create mode 100755 comp/work/9/tanks.py (limited to 'comp/work/9') diff --git a/comp/work/9/scores.py b/comp/work/9/scores.py new file mode 100755 index 0000000..8abad3b --- /dev/null +++ b/comp/work/9/scores.py @@ -0,0 +1,21 @@ +scores = [[]] +for i in range(3): + tmp = [] + for j in range(5): + tmp.append(int(input(f"num {j}: "))) + scores.append(tmp) + +scores.pop(0) +for i in scores: + print(*i, "avg: ",(sum(i)/5), sep=" ") + +highest = scores[0][0] +lowest = scores[0][0] +for i in scores: + for j in i: + if j > highest: + highest = j + elif j < lowest: + lowest = j +print(f"highest: {highest}, lowest: {lowest}") + diff --git a/comp/work/9/tanks.py b/comp/work/9/tanks.py new file mode 100755 index 0000000..6584263 --- /dev/null +++ b/comp/work/9/tanks.py @@ -0,0 +1,10 @@ +board1 = [["."] * 10] * 10 +board2 = [["."] * 10] * 10 + +for i in board1: + print(*i, sep=" ") +for i in range(3): + board1[int(input("tank y: "))][int(input("tank x: "))] = "T" +for i in board1: + print(*i, sep=" ") + -- cgit v1.2.3