Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Morse Clock by TovarischZhukov
def checkio(times):
morse_time = []
a = [[2,4],[3,4],[3,4]]
for i, elem in enumerate(times.split(":")):
val = ""
for j in [0,1]:
val+=" "+format(int(elem.zfill(2)[j]), 'b').zfill(a[i][j]).replace("0",".").replace("1","-")
morse_time.append(val.strip())
return " : ".join(morse_time)
Dec. 15, 2015