Q. What is the output of the following code?
Code:
class A:
def __init__(self):
self.var = 1
a = A()
print(a.var)
β
Correct Answer: (B)
1
Explanation: The constructor `__init__` initializes `self.var` to 1.