Python Program to Calculate Area of Triangle Given Base & Height

Table of Contents

This python program calculates area of triangle from given value of base and height.

This program uses following formula to calculate area of triangle:

Area of Triangle = ½ * base * height

Python Source Code: Area of Triangle


# Area of triangle 

# Reading base & height
base = float(input('Enter base: '))
height = float(input('Enter height: '))

# Calcualtion
area_triangle = base*height/2

# Displaying result
print('Area of triangle is %f' %(area_triangle))

Python Output: Area of Triangle

Enter base: 23
Enter height: 32
Area of triangle is 368.000000