Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Morse Clock by tmaeda11235
def checkio(time_string):
time = "".join(map(lambda x: (len(x)==1)*("0"+x) or x,time_string.split(":")))
mag = [2, 4, 3, 4, 3, 4]
pad = [" ", " : ", " ", " : ", " ", ""]
return"".join(f"{int(t):0>{m}b}{p}".replace("0", ".").replace("1", "-") for t, m, p in zip(time, mag, pad))
Aug. 26, 2017
Comments: