Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Oh... look at the time! solution in Clear category for Clock Angle by maurice.makaay
def clock_angle(time):
hours, minutes = [int(t) for t in time.split(":")]
hour_hand_degrees = 360/12 * (hours%12 + minutes/60)
minute_hand_degrees = 360/12 * minutes/5
hand_angle = abs(hour_hand_degrees - minute_hand_degrees)
return hand_angle if hand_angle <= 180 else 360 - hand_angle
Nov. 3, 2014
Comments: