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

CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad