What's going on with the lambda expression in this python function?

前端 未结 4 1440
甜味超标
甜味超标 2020-12-19 11:53

Why does this attempt at creating a list of curried functions not work?

def p(x, num):
    print x, num

def test():
    a = []
    for i in range(10):
             


        
4条回答
  •  天涯浪人
    2020-12-19 12:10

    I asked a similar question, and got two answers. One basically the same as the accepted answer here, and the other which is less clear but slightly more succint.

    Dynamically creating a menu in Tkinter. (lambda expressions?)

提交回复
热议问题