- Related Questions & Answers
- Java Program to calculate the area of a triangle using Heron's Formula
- Program to calculate area and perimeter of equilateral triangle
- Program to calculate area of Circumcircle of an Equilateral Triangle
- Python Program to calculate the area of a Tetrahedron
- C++ Program to Compute the Area of a Triangle Using Determinants
- Program to calculate area and perimeter of equilateral triangle in C++
- Program to calculate area of Circumcircle of an Equilateral Triangle in C++
- Program to calculate the Area and Perimeter of Incircle of an Equilateral Triangle What is Equilateral Triangle in C?
- Java program to find the area of a triangle
- Area of Reuleaux Triangle?
- Program to calculate the area of a Tetrahedron
- Largest Triangle Area in Python
- Area of Circumcircle of a Right Angled Triangle?
- Program to calculate area of Enneagon
- Program to calculate Area Of Octagon

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Calculating the area of a triangle is a formula that you can easily implement in python. If you have the base and height of the triangle, you can use the following code to get the area of the triangle,

def get_area(base, height): return 0.5 * base * height print(get_area(10, 15))

This will give the output:

75

If you have the sides of the triangle, you can use herons formula to get the area. For example,

def get_area(a, b, c): s = (a+b+c)/2 return (s*(s-a)*(s-b)*(s-c)) ** 0.5 print(get_area(10, 15, 10))

This will give the output:

49.607837082461074

Advertisements