-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSchool.py
More file actions
40 lines (29 loc) · 888 Bytes
/
School.py
File metadata and controls
40 lines (29 loc) · 888 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
class Test(object):
"""This class will create a new test"""
score = 0
def __init__(self, score=None):
if score != None:
if score in range(1, 100):
self.score = score
else:
raise Exception ('invalid score')
def printTest(self):
print "the score = " + str(self.score)
test = Test(40)
test.printTest()
class Student(object):
"""This class will create a new student"""
name = ""
testList = []
)
def __init__(self, name=None, test=None):
if self.name != None:
self.name = name
else:
self.name = "Jane Doe"
##self.tests.append = testTest(75))
def printStudent(self):
print self.name + " "
print self.testList
student = Student("Lauren")
student.printStudent()