Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def findtime(seconds):
- if seconds == None: seconds = 0
- minutes = 0
- hours = 0
- days = 0
- years = 0
- while seconds >= 60:
- seconds = seconds - 60
- minutes = minutes + 1
- while minutes >= 60:
- minutes = minutes - 60
- hours = hours + 1
- while hours >= 24:
- hours = hours - 24
- days = days + 1
- while days >= 365:
- days = days - 365
- years = years + 1
- #LINE OF STRINGS -----
- if seconds < 10: seconds = "0"+str(seconds)
- seconds = str(seconds)
- if minutes < 10: minutes = "0"+str(minutes)
- minutes = str(minutes)
- if hours < 10: hours = "0"+str(hours)
- hours = str(hours)
- if days < 10: days = "0"+str(days)
- days = str(days)
- if years < 10: years = "0"+str(years)
- years = str(years)
- print("-------------------\n"+years+":"+days+":"+hours+":"+minutes+":"+seconds+"\nyy:dd:hh:mm:ss\n\n")
- while True:
- kek = int(input("seconds: "))
- findtime(kek)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement