Show the printout of the following code:
class A:
def __init__(self, i = 0):
self.i = i
def m1(self):
self.i += 1
def __str__(self):
return str(self.i)
x = A(8)
print(x)
Program:
class A:
def __init__(self, i = 0):
self.i = i
def m1(self):
self.i += 1
def __str__(self):
return str(self.i)
x = A(8)
print(x)
Output:
Python 3.2.1 (default, Jul 10 2011, 21:51:15) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
8
>>>