摘要: 题目: lst = [lambda x: x*i for i in range(4)] res = [m(2) for m in lst] print res 实际输出:[6, 6, 6, 6] 想要输出 [0, 2, 4, 6] 应该怎么改?如下: lst = [lambda x, i=i: x* 阅读全文
posted @ 2019-12-22 12:54 shengguorui 阅读(1017) 评论(0) 推荐(1) 编辑