We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 229f8d6 commit 0b03f26Copy full SHA for 0b03f26
1 file changed
AreaTriangle
@@ -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