First, solve the problem. Then, write the code.
Search
Search
Login
Register
Home
Articles
Snippets
Topics
My Likes
My Favourites
Python Calculate the Area of a Triangle
Language
Python (3.8.1)
a = 4 b = 5 c = 6 # calculate the semi-perimeter of a triangle s = (a + b + c) / 2 # calculate the area area = (s*(s-a)*(s-b)*(s-c)) ** 0.5 print('The area of the triangle is %0.2f' %area)
Run Code
* Temp disabled. Under development!
IDE
The area of the triangle is 9.92
Execution time:
0.02 sec.
Info
Language:
Python (3.8.1)
Shared By:
Md Obydullah
Link:
Copy
plz wait...