Programming Examples
Python program to accept the Base and Perpendicular and find the Hypotenuse
Write a python program to accept the Base and Perpendicular for right angled triangle from user and find the Hypotenuse
Hint: h2=b2+p2
import math
base=float(input("Enter the length of base "))
per=float(input("Enter the length of Perpendicular "))
hyp=math.sqrt(base*base+per*per)
print("Length of Hypotenuse is : ",hyp)
Output
Enter the length of base 4
Enter the length of Perpendicular 3
Length of Hypotenuse is :Â 5.0