seconds = 62
print(seconds % 60, "secs")
print("%02d" % 2)
I cannot think of a way to get the one minute
I want the output as => 01 mins 02 secs
seconds = 62
print(seconds % 60, "secs")
print("%02d" % 2)
I cannot think of a way to get the one minute
I want the output as => 01 mins 02 secs
minute = int(62 / 60)
seconds = 62 % 60
print('%02d minute'% minute, end=' ')
print('%02d secs'% seconds)
The output will be 1 minute 2 secs.
You could use Python f-strings.
print(f'{int(seconds / 60):02} mins {int(seconds % 60):02} seconds')