forked from c3c1l1a/Python-advance-tracks
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathclasses.py
More file actions
54 lines (44 loc) · 1.66 KB
/
classes.py
File metadata and controls
54 lines (44 loc) · 1.66 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
# Your Code here
#Random person
random_person = Person("Johnson", "Mwelusi", "Mwema")
print random_person.first_name #"Johnson"
print random_person.middle_name #"Mwelusi"
print random_person.surname #Mwema
print random_person.number #"0000"
# Student 1
jane = Student(Student.POSTGRADUATE, "Jane", "Smith", "Thomson")
print jane.first_name #"Jane"
print jane.middle_name #"Smith"
print jane.surname #Thomson
print jane.number #"0000"
print jane.student_type #"POSTGRADUATE"
jane.enrol("Introduction to data science")
jane.enrol("IOT")
print jane.classes #['Introduction to data science', 'IOT']
#Student 2
john = Student(Student.UNDERGRADUATE, "John", "Jay", "Larson", 1123)
print john.first_name #"John"
print john.middle_name #"Jay"
print john.surname #"Larson"
print john.number #"1123"
print john.student_type #"UNDERGRADUATE"
john.enrol("Introduction to python")
john.enrol("Introduction to DBs")
print john.classes #['Introduction to python', 'Introduction to DBs']
#Random staffmember
staff_member = StaffMember(StaffMember.TEMPORARY, "Bob", "A.", "Jackson", "535")
print staff_member.employment_type #TEMPORARY
print staff_member.first_name #"Bob"
print staff_member.middle_name #"A."
print staff_member.surname #"Jackson"
print staff_member.number #"535"
#Lecturer
helen = Lecturer(StaffMember.PERMANENT, "Helen", "B.", "Jess", "1234")
print helen.employment_type #PERMANENT
print helen.first_name #"Helen"
print helen.middle_name #"B."
print helen.surname #"Jess"
print helen.number #"1234"
helen.assign_teaching("Introduction to data science")
helen.assign_teaching("Introduction to DBs")
print helen.courses_taught #['Introduction to data science', 'Introduction to DBs']