-5
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

2 Answers2

0
    minute = int(62 / 60)
    seconds = 62 % 60
    print('%02d minute'% minute, end=' ')
    print('%02d secs'% seconds)

The output will be 1 minute 2 secs.

0

You could use Python f-strings.

print(f'{int(seconds / 60):02} mins {int(seconds % 60):02} seconds')
Leo Qi
  • 557
  • 5
  • 13