Saturday, April 20, 2024

📑 Lambda Multipliers

📑 Task

1) What objects does the program create?
2) What will be the result of running the code?
3) Can you suggest improvements of the program?

📑 Answer

1) The program creates a list of lambda functions
2) The code will print out four identical numbers 12
(the lambda functionsmultiplie the arguments equal to 3 by the same factor m=4)
3) To create lambda functions with different multipliers from 1 to m,
in the loop you need to change the definition of the variable "_"

No comments:

Post a Comment