What is the output of the following code:
class MyClass:
count = 0
def init(self):
MyClass.count += 1
obj1 = MyClass()
obj2 = MyClass()
print(obj1.count)
count = 0
def init(self):
MyClass.count += 1
obj1 = MyClass()
obj2 = MyClass()
print(obj1.count)
What is the output of the following code:class MyClass: Correct Answer An error will occur
count = 0
def init(self):
MyClass.count += 1
obj1 = MyClass()
obj2 = MyClass()
print(obj1.count)
মোঃ আরিফুল ইসলাম
Feb 20, 2025