Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
format and translate solution in Clear category for Morse Clock by karlian
from itertools import chain
def checkio(time_string: str) -> str:
return (
"{:02b} {:04b} : {:03b} {:04b} : {:03b} {:04b}" .format(
*map(int, chain(*map("{:0>2}".format, time_string.split(":"))))
).translate(str.maketrans("01", ".-"))
)
May 25, 2022