-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheggtimer.py
More file actions
47 lines (33 loc) · 1.08 KB
/
eggtimer.py
File metadata and controls
47 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
import time
#----------------
#Function definitions
#----------------
def first_wait_period():
x=6 # Alton recommends eight minutes. So we do
# six here + 2 1m functions later for msgs
for n in range(0, x): # Do this loop x times (x mins)
print('There are',x+2,'minutes left.') # Print a running count of the time left
time.sleep(60) # Sleep one minute per loop iteration
x=x-1 # Iterate
return # End of function
def min_seven(): # With two minutes left,
print('Only two minutes left now!') # egg the user on
time.sleep(60)
return
def min_eight(): # One minute
print('Just sixty seconds to go!') # warning!
time.sleep(60)
return
def egg_timer():
print('The Alton Brown egg timer!')
input('Boil egg(s) in kettle. Hit enter when the kettle shuts itself off')
first_wait_period()
min_seven()
min_eight()
print('Hooray your eggs are cooked, enjoy!')
return
#----------------
# Main program
#----------------
egg_timer()