Suppose a, b, and c denote the lengths of the sides of a triangle. Then the area of the triangle can be calculated using the formula:

where
Write a program that asks the user to input the length of sides of the triangle and print the area.

Source Code

a = int(input("Enter the length of side a: "))
b = int(input("Enter the length of side b: "))
c = int(input("Enter the length of side c: "))
        
s = (a + b + c) / 2
area = (s * (s - a) * (s - b) * (s - c)) ** 0.5
        
print("The area of the triangle is:", area)

Output

Enter the length of side a: 5
Enter the length of side b: 12
Enter the length of side c: 13
The area of the triangle is: 30.0