To find area of triangle in python programming

# Find the area of triangle

a = 5
b = 6
c = 7

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

# calculate the area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('The area of the triangle is %0.2f' %area)


Output:The area of the triangle is 14.70

Comments

Popular posts from this blog

program to find the multiples of a number ( the divisor) out of given five numbers.

program that reads two numbers and an arithmetic operator and displays the computed result.

program to display a menu for calculating area of a circle or perimeter of a circle.