scipiguy

GUIZero Countdown Timer

Nov 17th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. from time import sleep
  2.  
  3. def countdown(t):
  4.     while t > 0:
  5.         if t//60 == 1:
  6.             suffix = "minute"
  7.         else:
  8.             suffix = "minutes"
  9.         print(t//60, suffix, (t-(t//60)*60), "seconds")
  10.         t -= 1
  11.         sleep(1)
  12.  
  13. countdown(120)
  14. print("Game Over")
Advertisement
Add Comment
Please, Sign In to add comment