| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 file changed
| Original file line number | Diff line number | Diff 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) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments