Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
6-liner: time module & our the hour-min equation solution in Creative category for Clock Angle by Stensen
from math import fabs
from time import strptime, strftime
def clock_angle(time):
h, m = map(int, strftime('%I:%M', strptime(time, '%H:%M')).rsplit(':'))
answer = fabs(30*h - 5.5*m)
return answer if answer <= 180 else 360 - answer
Oct. 23, 2020