1class awwab(object):
2 def __init__(self, name, age):
3 self.name = name
4 self.age = age
5
6 def speak(self):
7 print("Hello, my name is",self.name,"and I am",self.age,"years old!")
8
9awwabasad = awwab("Awwab Asad", 11)
10print(awwabasad.speak())
11
12class naail(awwab):
13 def __init(self, name, age):
14 super().__init__(self, name, age)
15
16naailasad = naail("Naail Asad", 8)
17print(naailasad.speak())
1class Bird():
2 def eat(self):
3 print ("eating")
4
5class Sparrow(Bird):
6 def sound(self):
7 print ("ChiChi!")
8
9birdobj = Sparrow()
10birdobj.eat()
11birdobj.sound()