Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple but redundant solution in Clear category for Morse Clock by nakanohito_piyo
def checkio(time_string):
ret = []
h,m,s = time_string.split(":")
ret.append(format(int(h)//10, '02b'))
ret.append(format(int(h)%10, '04b'))
ret.append(":")
ret.append(format(int(m)//10, '03b'))
ret.append(format(int(m)%10, '04b'))
ret.append(":")
ret.append(format(int(s)//10, '03b'))
ret.append(format(int(s)%10, '04b'))
return " ".join(ret).replace("0", ".").replace("1", "-")
June 26, 2015
Comments: