Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Short, sweet, and dressed with a sprinkle of #comment :D solution in Clear category for Clock Angle by dan_rue
def clock_angle(time):
h, m = map(int, time.split(":"))
# 6 degree -> 1 minute for the minute arm, 30 degre -> 1 hour and 0.5 -> 1 minute for the hour arm
angle = abs((6 * m) - (30 * (h % 12) + 0.5 * m))
return min(angle, 360 - angle)
Dec. 4, 2022
Comments: