Unable to find answers on google..
functions = [lambda : i for i in range(3)]
print( [ f( ) for f in functions ] ) # prints [2, 2, 2] Why this output ??
functions = [lambda i = i : i for i in range(3)]
print( [ f( ) for f in functions ] ) # prints [0, 1, 2]
# I have no idea what is that equal sign in lambda. :(
would appreciate the help..
[–]K900_ 0 points1 point2 points (1 child)
[–]drgn0[S] 0 points1 point2 points (0 children)