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()])

Questions & AnswersCategory: Programming LanguageWhat 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()])
Adam asked 2 years ago

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()])

a. [0,1,2,3]
b. [0,2,4,6]
c. [0,0,0,0]
d. [6,6,6,6]