arr, time = [8, 1, 7, 2, 6, 3, 5, 4, 12, 11, 10, 9], "05:30:00"
def clock_angle(arr, time):
a = [x % 12 for x in arr]
print(a)
h, m, s = map(int, time.split(":"))
H = h + m / 60 + s / 3600
x, fx = int(H), H % 1
i, j = a.index(x % 12), a.index((x + 1) % 12)
print(x, fx, "i :", i)
th = 30 * (i + (min(12 - (j - i), j - i)) * fx)
M = (m + s / 60) / 5
y, fy = int(M), M % 1
k, l = a.index(y % 12), a.index((y + 1) % 12)
tm = 30 * (k + (min(l - k, 12 - (l - k))) * fy)
print("k :", k)
print(th, tm)
dt = abs(th - tm)
return min(dt, 360 - dt)
clock_angle(arr, time)
To embed this program on your website, copy the following code and paste it into your website's HTML: