Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Angles of a Triangle by suic
from math import acos, degrees
def checkio(a, b, c):
if not all(((a + b) > c, (a + c) > b, (b + c) > a)): return [0, 0, 0]
return sorted([cosine_law(a, b, c),
cosine_law(b, a, c),
cosine_law(c, a, b)])
def cosine_law(a, b, c):
return round(degrees(acos(((b * b + c * c) - a * a) / (2 * b * c))))
Sept. 28, 2014