0 votes
in Python by

What is the output of the following code?

def multipliers():

    return [lambda x : i * x for i in range(4)]

print([m(2) for m in multipliers()])

i) [6,6,6,6]  

ii) [0,2,4,6]

iii) [0,1,2,3]

iv) [0,0,0,0]

1 Answer

0 votes
by
i) [6,6,6,6]

Related questions

0 votes
asked Jan 19, 2021 in Python by SakshiSharma
+1 vote
asked Jan 19, 2021 in Python by SakshiSharma
...