LogiQuest
Back to Object Oriented Programming
12

What is the output of the following code?

class Dog:
    def __init__(self, name):
        self.name = name
    def speak(self):
        return self.name + ' barks'
print(Dog('Rex').speak())
Easy

Discussion (0)

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

Log in to join the discussion.