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

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad