How to find area of triangle using python code

In this tutorial, we are going to show How to find area of triangle using python code. We have added the video tutorial and the source code of the program.

Video Tutorial: Find area of triangle using python code

Source Code

# Python Program to find the area of triangle

a = float(input('Enter length of 1st side: '))
b = float(input('Enter length of 2nd side: '))
c = float(input('Enter length of 3rd side: '))

# Calculate semi-perimeter
s = (a + b + c) / 2

# Calculate Area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('\nArea of the triangle is ',area)

Output

Also Read: Python program to create bmi calculator

Join Now : Learn Python Programming Masterclass

Leave a Reply

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