class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def walk(self):
print('I am walking')
def __str__(self):
return 'name: {}\tage:{}'.format(self.name, self.age)
p1 = Person('Ahmed', 30)
print(p1)
class Student(Person):
def __init__(self, std_id, name, age):
self.std_id = std_id
super().__init__(name, age)
def study(self):
print('I am studying')
def __str__(self):
return 'id: {}\t{}'.format(self.std_id, super().__str__())
s1 = Student('120191122', 'Ahmed', 20)
print(s1)