Skip to content

Instantly share code, notes, and snippets.

@awgreene
Last active February 11, 2018 15:03
Show Gist options
  • Save awgreene/9a834e95312e758e8c3f52f880355e07 to your computer and use it in GitHub Desktop.
Save awgreene/9a834e95312e758e8c3f52f880355e07 to your computer and use it in GitHub Desktop.
from sys import argv
from time import sleep
# Set time to first argument
time = argv[1]
# Set seconds to integer representation of time
seconds = int(time)
# Make sure time provided is greater than or equal to zero
if(seconds < 0):
print("Time must be greater than or equal to zero")
quit()
# Start countdown
while(seconds > 0):
print(str(seconds) + " second(s) remaining...")
seconds -= 1
sleep (1)
print("Beep! Beep! Beep! " + time + " second(s) have passed!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment