2019年1月11日

摘要: 1. 在类中的使用 class Vector(): def __init__(self,outList): self.innerList = outList def __len__(self): return len(self.innerList) def __str__(self): return 阅读全文

posted @ 2019-01-11 19:06 return归来 阅读(293) 评论(0) 推荐(0)

摘要: Python 之 for循环中的lambda 第一种 f = [lambda x: x*i for i in range(4)] (如果将x换成i,调用时候就不用传参数,结果都为3) 对于上面的表达式,调用结果: 上面的表达式展开如下: 当调用 func() 时,每循环一次,将 lam 函数的地址存 阅读全文

posted @ 2019-01-11 09:56 return归来 阅读(1667) 评论(0) 推荐(0)