All problems
MediumOOP
Inheritance
Create `Animal` with `speak()` and `Dog(Animal)` overriding speak to print "Bark".
- #class
- #inheritance
Sample input
Dog().speak()
Sample output
Bark
class-inheritance.py
Output
Press "Run code" to execute.
Loading…
Create `Animal` with `speak()` and `Dog(Animal)` overriding speak to print "Bark".
Dog().speak()
Bark
Press "Run code" to execute.