Examveda

What is the output of the following code:
class MyClass:
x = 5
obj = MyClass()
print(obj.x)

A. 5

B. An error will occur

C. obj

D. MyClass

Answer: Option C


This Question Belongs to Python Program >> Classes And Objects In Python

Join The Discussion

Related Questions on Classes and Objects in Python