forked from Lazigerbill/timer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer.py
More file actions
26 lines (17 loc) · 705 Bytes
/
timer.py
File metadata and controls
26 lines (17 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
This program is used as an example for MGTC28.
timer.py is a simple Python script that will allow user to set timer duration.
Upon timer expiry, user will see the time up meme and sound notification.
timer.py uses the time library to help keep track of time
"""
# This program is timer that counts down
import random
import time # The time library has a sleep function that will pause the script for a specifized amount of time
#Game Start display begin signal
print ("Player stand")
#Randomly generate a sleep time
set_time = random.randint(5,25)
#Stall the program by the randomly generated number
time.sleep(set_time)
#Game End display end signal
print ("Time Up. Last to Sit down wins")