We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99cf7d7 commit 8ebd320Copy full SHA for 8ebd320
1 file changed
AreaTriangle
@@ -8,3 +8,21 @@ s = (a + b + c) / 2
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)
11
+or
12
+# Python Program to find the area of triangle
13
+
14
+a = 5
15
+b = 6
16
+c = 7
17
18
+# Uncomment below to take inputs from the user
19
+# a = float(input('Enter first side: '))
20
+# b = float(input('Enter second side: '))
21
+# c = float(input('Enter third side: '))
22
23
+# calculate the semi-perimeter
24
+s = (a + b + c) / 2
25
26
+# calculate the area
27
+area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
28
+print('The area of the triangle is %0.2f' %area)
0 commit comments