Skip to content

Commit b860798

Browse files
Merge pull request seeditsolution#203 from lalit19/patch-1
Create AreaTriangle
2 parents ddd3da6 + 0b03f26 commit b860798

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

AreaTriangle

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

0 commit comments

Comments
 (0)