Blog

What is the output of the following code?

class example:
def __init__(self, x, y):
self.attribute = x * y
a = example(5, 5)
b = getattr(a, ‘attribute’)
setattr(a, ‘attribute’, b*5)
print(a.attribute)