Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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