Advertisement
GameNationRDF

Simple Timer in Python Version 2.0 (added minute countdown)

Sep 6th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. #Simple Timer in Python.. Great for YouTube People! version 2.0
  2. #Code by GameNationRDF
  3. import time
  4. while True:
  5.     userTimeMode = str(input("Minutes or Seconds? (m/s): "))
  6.     if userTimeMode == ("m"):
  7.         userLimitMin = int(input("Set your timer (minutes): "))
  8.         userLimit = (userLimitMin * 60)
  9.     else:
  10.         userLimit = int(input("Set your timer (seconds): "))
  11.     userMode  = str(input("Display mode? (y/n): "))
  12.     if userMode == ("exit"):
  13.             break
  14.     for i in range(1, userLimit):
  15.         if userMode == ("y") or userMode == ("Y"):
  16.             print (i)
  17.         time.sleep(1.0)
  18.     print ("Countdown finished!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement