class Bird:
def intro(self):
print("We are birds!")
def flight(self):
print("Wow we can fly but some cannot.")
class crow(Bird):
def flight(self):
print("Crows can fly.")
class ostrich(Bird):
def flight(self):
print("Ostriches cannot fly.")
obj_bird = Bird()
obj_cro = crow()
obj_ost = ostrich()
obj_bird.intro()
obj_bird.flight()
obj_cro.intro()
obj_cro.flight()
obj_ost.intro()
obj_ost.flight()
Output:
We are birds! Wow we can fly but some cannot. We are birds! Crows can fly. We are birds! Ostriches cannot fly.
Output:
We are birds!
need an explanation for this answer? contact us directly to get an explanation for this answerWow we can fly but some cannot.
We are birds!
Crows can fly.
We are birds!
Ostriches cannot fly.