-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbreak_me.py
More file actions
75 lines (60 loc) · 2.01 KB
/
Copy pathbreak_me.py
File metadata and controls
75 lines (60 loc) · 2.01 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# ****************************************************************************
# Title: break_me.py lesson01
# Written By: Andy Simpson
# Date: 04/12/2020
# ****************************************************************************
# Global Variables -------------------------------------------------------------------- #
# Processing --------------------------------------------------------------- #
class BreakStuff:
""" Performs Processing tasks """
@staticmethod
def name_error():
""" Reads data from a file into a list of dictionary rows
:return: (string) the "Name" Error Type Message
"""
try:
4 + spam*3
except Exception as e:
print(e)
return e.__cause__
@staticmethod
def type_error():
""" Reads data from a file into a list of dictionary rows
:return: (string) the "Name" Error Type Message
"""
try:
badtype = 2 + "two"
print("Bad Type Error %s") % badtype
except Exception as e:
print(e)
return e
@staticmethod
def syntax_error():
""" Reads data from a file into a list of dictionary rows
:return: (string) the "Name" Error Type Message
"""
try:
while True :
print('Hello world')
except Exception as e:
print(e)
return e.__cause__
@staticmethod
def attribute_error():
""" Reads data from a file into a list of dictionary rows
:return: (string) the "Name" Error Type Message
"""
try:
x = 10
x.append(6)
except Exception as e:
print(e)
return e
# Main Body of Script ---------------------------------------------------- #
# Load data from file into a list of employee objects when script starts
# BreakStuff.name_error()
# strError = BreakStuff.type_error()
# BreakStuff.syntax_error()
BreakStuff.attribute_error()
#print(strError)
print("Finished")