diff options
author | standenboy <standenboy@seacrossedlovers.xyz> | 2023-12-15 10:19:20 +0000 |
---|---|---|
committer | standenboy <standenboy@seacrossedlovers.xyz> | 2023-12-15 10:19:20 +0000 |
commit | 4a95719d58a708ad55b1389631d6339047f786a0 (patch) | |
tree | 26cb6fc2dbe7fa75f57f1d6fb13aff8955772b56 /comp/hw |
added existing work
Diffstat (limited to 'comp/hw')
-rwxr-xr-x | comp/hw/1/1.py | 4 | ||||
-rwxr-xr-x | comp/hw/1/2.py | 7 | ||||
-rwxr-xr-x | comp/hw/1/3.py | 10 | ||||
-rwxr-xr-x | comp/hw/1/4.py | 31 |
4 files changed, 52 insertions, 0 deletions
diff --git a/comp/hw/1/1.py b/comp/hw/1/1.py new file mode 100755 index 0000000..4eee13e --- /dev/null +++ b/comp/hw/1/1.py @@ -0,0 +1,4 @@ +num = int(input("number: ")) +for i in range(10,21): + if num == i: + print("is in range") diff --git a/comp/hw/1/2.py b/comp/hw/1/2.py new file mode 100755 index 0000000..dd1c619 --- /dev/null +++ b/comp/hw/1/2.py @@ -0,0 +1,7 @@ +age = int(input("age: ")) +if age >= 18: + print("user is an adult") +elif age < 13: + print("user is a child") +else: + print("user is a teenager") diff --git a/comp/hw/1/3.py b/comp/hw/1/3.py new file mode 100755 index 0000000..a84d7e2 --- /dev/null +++ b/comp/hw/1/3.py @@ -0,0 +1,10 @@ +import sys +num = [] +num.append(int(input("number: "))) +num.append(int(input("number: "))) +num.append(int(input("number: "))) + +num.sort() +for i in num: + sys.stdout.write(f"{i} ") +print("\n") diff --git a/comp/hw/1/4.py b/comp/hw/1/4.py new file mode 100755 index 0000000..fb28133 --- /dev/null +++ b/comp/hw/1/4.py @@ -0,0 +1,31 @@ +marks = [] +marks.append(int(input("analysis: "))) +marks.append(int(input("design: "))) +marks.append(int(input("implimentation: "))) +marks.append(int(input("evaluation: "))) + +total = 0 +for i in marks: + total = total + i + +if total >= 80: + print("9") +elif 80 > total >= 67: + print("8") +elif 67 < total <= 54: + print("7") +elif 54 < total <= 41: + print("6") +elif 41 < total <= 31: + print("5") +elif 31 < total <= 22: + print("4") +elif 22 < total <= 13: + print("3") +elif 13 < total <= 4: + print("2") +elif 4 < total <= 2: + print("1") +else: + print("U") +print("total ", total) |