-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheggtimer.py
More file actions
executable file
·59 lines (53 loc) · 1.44 KB
/
eggtimer.py
File metadata and controls
executable file
·59 lines (53 loc) · 1.44 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
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
# last edited oct 9 2018 by veronica
import time
#Function definitions:
#
def greet():
egg_art = '''
'''
print (r"""
.-~-.
.' '.
/ \
.-~-. : ;
.' '.| |
/ \ :
: ; .-~""~-,/
| /` `'.
: | \
\ | /
`. .' \ .'
jgs `~~~` '-.____.-'
""")
print('The Alton Brown electric kettle egg timer\n')
input('Boil your egg(s) in the kettle. Press a key when the kettle shuts itself off')
return
#
#
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
# Main program
greet()
first_wait_period()
min_seven()
min_eight()
print('Hooray your eggs are cooked, enjoy!')