Write a Python program to calculate the hypotenuse of a right angled triangle using math library


Topic: Write a Python program to calculate the hypotenuse of a right angled triangle using math library

Solution

from math import sqrt
print("Input lengths of shorter triangle sides:")
def hypotenuse(side1, side2):
    hyp = sqrt(side1**2 + side2**2)
    return hyp



List all Python Programs