-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent.py
45 lines (38 loc) · 1.51 KB
/
student.py
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
'''
Student class, extends from Person class | ctto -> Sir Dennis Durano
'''
class Student():
def __init__(self,**args):
self.idno = args.get('idno')
self.lastname= args.get('lastname')
self.firstname = args.get('firstname')
self.course = args.get('course')
self.level = args.get('level')
def __str__(self)->dict:
#return f"{self.idno},{self.lastname},{self.firstname},{self.course},{self.level}"
studenrecord = {
'idno':self.idno,
'lastname':self.lastname,
'firstname':self.firstname,
'course':self.course,
'level':self.level
}
return studenrecord
def __eq__(self,other)->bool:
if type(other) != type(self):
return False
elif self.idno == other.idno:
return True
else:
return False
#user-defined modules
#setters
def setidno(self,idno:str)->None: self.idno = idno
def setcourse(self,course:str)->None: self.course = course
def setlevel(self,level:str)->None: self.level = level
#getters
def getidno(self)->str: return self.idno
def getlastname(self)->str: return self.lastname
def getfirstname(self)->str: return self.firstname
def getcourse(self)->str: return self.course
def getlevel(self)->str: return self.level