forked from RanitPradhan/work
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlab_3.py
More file actions
31 lines (25 loc) · 841 Bytes
/
lab_3.py
File metadata and controls
31 lines (25 loc) · 841 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
"""
OOP || Lab sheet 3 || Ranit Pradhan || AM.EN.U4ELC19028
"""
class student(object):
def __init__(self, name = "Ranit Pradhan", age = 20, fathers_name = "Biswajit Pradhan", phone_num = 9352618795, roll = 28):
self.info ={
"roll number": roll,
"name" : name,
"age": age,
"father's name": fathers_name,
"phone_number": phone_num
}
def display_info(self):
print(self.info)
students = [student(roll = i) for i in range(5)]
class school(object):
def __init__(self, students):
self.student1 = students[0]
self.student2 = students[1]
self._student3 = students[2]
self._student4 = students[3]
self._student5 = students[4]
s = school(students)
s.student1.display_info()
s.student2.display_info()