Python anonymous function correlation


print

the second question, is that the closure?
I hope someone can give me some advice

.
Apr.05,2021

  1. try
m = multipliers()
print(m, m[0][1])

2. Three elements of closure

  • embedded functions (anonymous functions)
  • external function returns embedded function (returns anonymous function)
  • the embedded function refers to the free variable of the outer function (the free variable I)

Anonymous function colon is preceded by args, that is, parameter

Menu