Take this code snippet for example:
a = [] for x in range(2): a.append(lambda: print(x)) print(a[0](), a[1]())
The output is: