Spot the bug Python
1
# Count how many answers each survey collected.
2
class Survey:
3
responses = []
4
def record(self, answer):
5
self.responses.append(answer)
6
7
lunch = Survey()
8
retro = Survey()
9
lunch.record("pizza")10
print(len(retro.responses))
11
# expected: 0
12
# actual: 1 (!)