Question 16
What is the output of the following Python code?
class A:
def __init__{self, x}:
self.x = xlist_of_objs = [A(i) for i in range(1, 6)]
print(sum(obj.x for obj in list_of_objs))
list_of_objs holds A(1), A(2), A(3), A(4), A(5). Sum of x values = 1 + 2 + 3 + 4 + 5 = 15.