def format_time(minutes): hours_total = minutes // 60 # Get additional minutes with modulus minutes_total = minutes % 60 # Create time as a string time_string = "{} hours {} minutes".format(hours_total, minutes_total) return time_string
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter