forked from fenyx-it-academy/Class6-Python-Module-Week5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5.4.py
More file actions
24 lines (19 loc) · 629 Bytes
/
Copy path5.4.py
File metadata and controls
24 lines (19 loc) · 629 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
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def display(self):
print("Person name : ", self.name)
print("Person age = ", self.age)
class Student(Person):
def __init__(self, name , age , section):
super().__init__(name, age)
self.section = section
def displayStudent(self):
print("Student name : ", self.name)
print("Student age = ", self.age)
print("Student section = ", self.section)
P = Person("Tomas Wild", 37)
P.display()
S = Student("Albert", 23 , "Mathematics")
S.displayStudent()