Results of anonymous function
Question
Given the below code snippet...
functions = []
for i in range(7):
functions.append(lambda: i)
for f in functions:
print(f())
...share what is printed out. Additionally, share how we could we fix the anonymous (lambda) functions to return what we might have expected.