1
1
Fork 0

hypotenuse
Some checks failed
Actions / Lint Code (Ruff & Pylint) (push) Failing after 10s

This commit is contained in:
SeaswimmerTheFsh 2024-05-08 10:41:01 -04:00
parent 4937c519fa
commit a7581a0bf6
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F
2 changed files with 16 additions and 0 deletions

0
hypotenuse/__init__.py Normal file
View file

16
hypotenuse/main.py Normal file
View file

@ -0,0 +1,16 @@
from math import sqrt
def calculate_hypotenuse(x: float, y: float) -> float:
x = float(x)
y = float(y)
return sqrt(x**2 + y**2)
if __name__ == "__main__":
x = input("Input your A: ")
y = input("Input your B: ")
try:
result = calculate_hypotenuse(x,y)
print(f"{round(result)} ({result})")
except ValueError:
print("Error! Please do not input strings.")