forked from UWPCE-PythonCert/ProgrammingInPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexcept_test.py
More file actions
41 lines (32 loc) · 975 Bytes
/
Copy pathexcept_test.py
File metadata and controls
41 lines (32 loc) · 975 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
"""
silly little test module that is designed to trigger Exceptions when
run from the except_exercise.py file
"""
import time
conclude = "And what leads you to that conclusion?"
district = "Finest in the district, sir."
cheese = "It's certainly uncontaminated by cheese."
clean = "Well, it's so clean."
shop = "Not much of a cheese shop really, is it?"
cust = "Customer: "
clerk = "Shopkeeper: "
def fun(reaper):
if reaper == 'spam':
print(s)
elif reaper == 'cheese':
print()
print('Spam, Spam, Spam, Spam, Beautiful Spam')
elif reaper == 'mr death':
print()
return('{}{}\n{}{}'.format(cust, shop, clerk, district))
def more_fun(language):
if language == 'java':
test = [1, 2, 3]
test[5] = language
elif language == 'c':
print('{}{}\n{}{}'.format(cust, conclude, clerk, clean))
def last_fun():
print(cust, cheese)
time.sleep(1)
import antigravity