Python program to find area of triangle (given base and height)

Hello everybody, welcome back! Here we learn how to find the area of a triangle when base and height of a triangle are given.

We calculate the area by multiplying base and height and dividing it with 2. Area = ( base * height ) / 2

We can also calculate area of triangle when all sides are given, using Heron’s formula. That can be found here.

Program on Github

Area of triangle – Code Visualization

Task :

To find the area of a triangle when base and height of a triangle are given.

Approach :

  • Read base and height of a triangle using input()orraw_input()
  • Multiply both base and height and divide it with 2
  • Area a = ( base * height ) / 2
  • Print the result.

Program on Github

Program :

Output :

Area of a triangle ( base and height ) - programminginpython.com
Area of a triangle ( base and height ) – programminginpython.com
Area of a triangle ( base and height ) - programminginpython.com
Area of a triangle ( base and height ) – programminginpython.com

Program on Github

Leave a Reply