Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created June 3, 2021 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/fa14cceb560e94fa1491109a2b41b45c to your computer and use it in GitHub Desktop.
Save amankharwal/fa14cceb560e94fa1491109a2b41b45c to your computer and use it in GitHub Desktop.
a = 5
b = 7
c = 10
# calculate the semi-perimeter
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment