Skip to content

Commit 5e5348d

Browse files
authored
Create Area of triangle
To calculate the area of the triangle
1 parent 2d34fc1 commit 5e5348d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Area of triangle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
a = 5
2+
b = 6
3+
c = 7
4+
# a = float(input('Enter first side: '))
5+
# b = float(input('Enter second side: '))
6+
# c = float(input('Enter third side: '))
7+
8+
# calculate the semi-perimeter
9+
s = (a + b + c) / 2
10+
11+
# calculate the area
12+
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
13+
print('The area of the triangle is %0.2f' %area)

0 commit comments

Comments
 (0)