Write a Python program to calculate area of an equilateral triangle.

SOLUTION....

# Program to calculate area of an equilateral triangle

import math   # for square root function

# Input
side = float(input("Enter the side of the equilateral triangle: "))

# Formula: (√3 / 4) × side²
area = (math.sqrt(3) / 4) * (side ** 2)

# Output
print(f"Area of the Equilateral Triangle = {area:.2f}")

OUTPUT

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.