Coding task · Python course · Module 3: Object-Oriented Programming

Class Methods

Add a method to the class

Task

Add a speak() method to the Animal class that prints the animal's sound, e.g. 'Simba: Roar!'. Create an animal and call speak()