(seconds: int)
return formatted
Takes seconds and formats them as [hh:]mm:ss.
Takes seconds and formats them as [hh:]mm:ss.
Takes seconds and formats them as [ hh : ] mm : ss .
def format_seconds(seconds: int) -> str:
    """Takes seconds and formats them as [hh:]mm:ss."""

    if seconds < 0:
        return "--:--"

    hours, seconds = seconds // 3600, seconds % 3600
    minutes, seconds = seconds // 60, seconds % 60

    formatted = ""
    if hours > 0:
        formatted += "{:d}:".format(int(hours))
    formatted += "{0:02d}:{1:02d}".format(int(minutes), int(seconds))
    return formatted
def format_seconds ( seconds : int ) -> str : if seconds < 0 : return "--:--" hours , seconds = seconds // 3600 , seconds % 3600 minutes , seconds = seconds // 60 , seconds % 60 formatted = "" if hours > 0 : formatted += "{:d}:" . format ( int ( hours ) ) formatted += "{0:02d}:{1:02d}" . format ( int ( minutes ) , int ( seconds ) ) return formatted