summaryrefslogtreecommitdiff
path: root/comp/work/4
diff options
context:
space:
mode:
authorstandenboy <standenboy@seacrossedlovers.xyz>2023-12-15 10:19:20 +0000
committerstandenboy <standenboy@seacrossedlovers.xyz>2023-12-15 10:19:20 +0000
commit4a95719d58a708ad55b1389631d6339047f786a0 (patch)
tree26cb6fc2dbe7fa75f57f1d6fb13aff8955772b56 /comp/work/4
added existing work
Diffstat (limited to 'comp/work/4')
-rwxr-xr-xcomp/work/4/pythagorus6
-rwxr-xr-xcomp/work/4/sumAndMean6
2 files changed, 12 insertions, 0 deletions
diff --git a/comp/work/4/pythagorus b/comp/work/4/pythagorus
new file mode 100755
index 0000000..d9c5cdc
--- /dev/null
+++ b/comp/work/4/pythagorus
@@ -0,0 +1,6 @@
+#!/usr/bin/python
+base = float(input("base: "))
+height = float(input("height: "))
+
+hyp = ((base ** 2) + (height ** 2)) ** 0.5
+print(hyp)
diff --git a/comp/work/4/sumAndMean b/comp/work/4/sumAndMean
new file mode 100755
index 0000000..1d46136
--- /dev/null
+++ b/comp/work/4/sumAndMean
@@ -0,0 +1,6 @@
+#!/usr/bin/python3
+numbers = []
+for i in range(5):
+ numbers.append(int(input(f"num {i}: ")))
+print(f"sum = {float(sum(numbers))}")
+print(f"average = {(sum(numbers) / 5)}")