programming-examples/python/_Basics/Calculate the hypotenuse of a right angled triangle.py

7 lines
207 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
from math import sqrt
print("Input lengths of shorter triangle sides:")
a = float(input("a: "))
b = float(input("b: "))
c = sqrt(a**2 + b**2)
print("The length of the hypotenuse is", c )