This commit is contained in:
parent
a7581a0bf6
commit
c55a25d874
1 changed files with 10 additions and 10 deletions
|
@ -2,15 +2,15 @@ from math import sqrt
|
|||
|
||||
|
||||
def calculate_hypotenuse(x: float, y: float) -> float:
|
||||
x = float(x)
|
||||
y = float(y)
|
||||
return sqrt(x**2 + y**2)
|
||||
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.")
|
||||
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.")
|
||||
|
|
Loading…
Reference in a new issue