Question: Look at the following class definition: class Bird: def _ _init_ _(self, bird_type): self._ _bird_type = bird_type Write the code for a class named Duck
Look at the following class definition:
class Bird:
def _ _init_ _(self, bird_type):
self._ _bird_type = bird_type
Write the code for a class named Duck that is a subclass of the Bird class. The Duck class’s _ _init_ _ method should call the Bird class’s _ _init_ _ method, passing ‘duck’ as an argument.
Step by Step Solution
3.43 Rating (162 Votes )
There are 3 Steps involved in it
To create a class named Duck that is a subclass of the Bird class we can use the following c... View full answer
Get step-by-step solutions from verified subject matter experts
