Programming Examples

Python program to accept three side of triangle and find its area by using Herons Formula


Write  a python program to accept 3 side of triangle and find its area by using Heron’s Formula

where s=(a+b+c)/2

import math
a=float(input("Enter the Side 1 "))
b=float(input("Enter the Side 2 "))
c=float(input("Enter the Side 3 "))
s=(a+b+c)/2
area=math.sqrt(s*(s-a)*(s-b)*(s-c))
print("Area of Triangle is : ",area)
Output

Enter the Side 1 5

Enter the Side 2 4

Enter the Side 3 3

Area of Triangle is :  6.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