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/ Explanation:

Enter the length of base 4

Enter the length of Perpendicular 3

Length of Hypotenuse is :  5.0

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad