Skip to content

Instantly share code, notes, and snippets.

@AdryDev92
Last active September 8, 2018 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdryDev92/fd6fa81509d6ce085b6c5bf92158ad7f to your computer and use it in GitHub Desktop.
Save AdryDev92/fd6fa81509d6ce085b6c5bf92158ad7f to your computer and use it in GitHub Desktop.
calculate hypotenuse
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