Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Morse Clock by a.a.v.worker
def checkio(time_string):
t_s = [i.zfill(2) for i in time_string.split(':')]
result = []
for i in range(len(t_s)):
m = []
for j in range(len(t_s[i])):
n = 2+2*j if i==0 else 3+j
m.append(bin(int(t_s[i][j]))[2:].zfill(n))
result.append(' '.join(m))
return ' : '.join(result).translate(str.maketrans('01', '.-'))
Sept. 12, 2015