diff options
Diffstat (limited to 'comp/work/4')
-rwxr-xr-x | comp/work/4/pythagorus | 6 | ||||
-rwxr-xr-x | comp/work/4/sumAndMean | 6 |
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)}") |