diff --git a/hypotenuse/__init__.py b/hypotenuse/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/hypotenuse/main.py b/hypotenuse/main.py new file mode 100644 index 0000000..664d776 --- /dev/null +++ b/hypotenuse/main.py @@ -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.")