Write a Python Program to Calculate the Area of a Triangle
All Answers
need an explanation for this answer? contact us directly to get an explanation for this answer
base=int(input("enter the base of the triangle:"))
height=int(input("enter the height of the triangle:"))
area=(base*height)*0.5
print("the area of the triangle of base:",base," and height:",height," is : ",area)
need an explanation for this answer? contact us directly to get an explanation for this answer
need an explanation for this answer? contact us directly to get an explanation for this answer
side1 = int(input('enter side1:'))
side2 = int(input('enter side2:'))
side3 = int(input('enter side3:'))
s = (side1 + side2 + side3) / 2;
area = (s * (s - side1) * (s - side2) * (s - side3))**0.5
print("The area of the triangle is " , area);
need an explanation for this answer? contact us directly to get an explanation for this answer
total answers (3)
program calculates the area of an Equilateral Triangle
Area of an Equilateral Triangle
An equilateral triangle is a triangle where all the sides are equal. The perpendicular drawn from the vertex of the triangle to the base divides the base into two equal parts. To calculate the area of the equilateral triangle, we have to know the measurement of its sides.
Area of an Equilateral Triangle = A = (√3)/4 × side2
Python Program:
need an explanation for this answer? contact us directly to get an explanation for this answer