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

Enter the Side 1 5

Enter the Side 2 4

Enter the Side 3 3

Area of Triangle is :  6.0

Latest Current Affairs 2024 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