Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Morse Clock by saklar13
def checkio(time_string):
res = []
for i, x in enumerate(time_string.split(':')):
t, o = int(x) // 10, int(x) % 10
s = '{:03b} '.format(t) if i else '{:02b} '.format(t)
s += '{:04b}'.format(o)
res.append(s)
return ' : '.join(res).replace('0', '.').replace('1', '-')
Jan. 23, 2015