LogiQuest
Back to Object Oriented Programming
15

What is the output of the following code?

class P:
    def __init__(self, x):
        self.x = x
    def __str__(self):
        return f'P({self.x})'
print(P(3))
Easy

Discussion (0)

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

Log in to join the discussion.