Advertisement
arunvsuresh

Untitled

Aug 21st, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. def convert_seconds(seconds):
  2.    
  3.     minute_count = 0
  4.     hour_count = 0
  5.    
  6.     remaining_seconds = int(seconds)
  7.    
  8.     #while remaining_seconds >= 3600:
  9.     while remaining_seconds / 3600 > 0:
  10.         hour_count += 1
  11.         remaining_seconds = remaining_seconds - 3600
  12.     while remaining_seconds / 60 > 0:
  13.         minute_count += 1
  14.         remaining_seconds = remaining_seconds - 60
  15.          
  16.     return hour_count, minute_count, remaining_seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement