Advertisement
dkyoseff

Conditional Statements - Exercise / 01. Sum Seconds

Jul 7th, 2022
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. import math
  2.  
  3. time_first = int(input())
  4. time_second = int(input())
  5. time_third = int(input())
  6.  
  7. total_time = time_first + time_second + time_third
  8.  
  9. minutes = total_time // 60
  10. seconds = total_time % 60
  11.  
  12. minutes = math.floor(minutes)
  13.  
  14. if seconds < 10:
  15.     print(f'{minutes}:0{seconds}')
  16. else:
  17.     print(f'{minutes}:{seconds}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement