gistlib
main.pydef format_time(hours, minutes, seconds): return f"{hours:02d}-{minutes:02d}-{seconds:02d}" 96 chars3 lines
def format_time(hours, minutes, seconds): return f"{hours:02d}-{minutes:02d}-{seconds:02d}"
In this function, we use string formatting with f-strings and the :02d format code to ensure that each number is zero-padded and has two digits.
f
:02d
gistlibby LogSnag