LogiQuest
Back to Object Oriented Programming
3

What is the output of the following code?

class Animal:
    def sound(self):
        return 'generic'
class Cat(Animal):
    def sound(self):
        return 'meow'
print(Cat().sound(), Animal().sound())
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.