This question already has an answer here:
- How get hours:minutes 4 answers
First of all, I'd like to point out that I'm a beginner with Python.
My problem is that I can't figure out what is the proper way to convert minutes to HH:MM format in Python.
Any help is appreciated!
Use the
divmod()
function:Here
divmod()
divides the minutes by 60, returning the number of hours and the remainder, in one.Demo: