Last active
September 8, 2018 02:41
-
-
Save AdryDev92/fd6fa81509d6ce085b6c5bf92158ad7f to your computer and use it in GitHub Desktop.
calculate hypotenuse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
#input lenght of a and b | |
print("Input lengths of a and b sides of triangle:") | |
a = float(input("side a: ")) | |
b = float(input("side b: ")) | |
#calculate square root of a and b | |
c = sqrt(a**2 + b**2) | |
#print result with decimals | |
print("The length of the hypotenuse is ", c ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment