- 微积分
- 蟒蛇编程
区分蟒蛇函数的Positional和Keyword参数。
Set(创建,访问和迭代)
列表理解(List Comprehension):下列两行代码是等价的。后者(ListComp)可读性更高。
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 squares = list(map(lambda x: x**2, range(10))) 2 squares = [x**2 for x in range(10)]
[(1, 3), (1, 4), (2, 3), (2, 1), (2, 4), (3, 1), (3, 4)]
例如:将二维数组展开:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 vec = [[1,2,3], [4,5,6], [7,8,9]] 2 [num for elem in vec for num in elem]
[1, 2, 3, 4, 5, 6, 7, 8, 9]