What will this code snippet print?
#!/usr/bin/python
class A(object):
def __init__(self, a={}):
if not a.has_key('1'):
a['1'] = 1
else:
a['1'] += 1
print a['1']
for i in range(3):
_ = A()
(Hint: it’s not not what you think.)
Leave a Reply