removed redundant folder
Signed-off-by: cswimr <seaswimmerthefsh@gmail.com>
This commit is contained in:
parent
bfceebd171
commit
914483337a
1 changed files with 0 additions and 23 deletions
|
@ -1,23 +0,0 @@
|
||||||
from math import sqrt
|
|
||||||
|
|
||||||
|
|
||||||
def calculate_hypotenuse(
|
|
||||||
x: float, y: float
|
|
||||||
) -> float: # This function will calculate our hypotenuse
|
|
||||||
x = float(
|
|
||||||
x
|
|
||||||
) # These 2 parts are both checks to attempt to convert our input into floats
|
|
||||||
y = float(y)
|
|
||||||
return sqrt(
|
|
||||||
x**2 + y**2
|
|
||||||
) # If we're able to convert both of our inputs into floats, we return our result
|
|
||||||
|
|
||||||
|
|
||||||
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.")
|
|
Loading…
Add table
Reference in a new issue