-
change iteration to simpler by 'in'
expression是可循环value,etc list. 顺序: 将每次循环的value绑定到name,然后再执行下面的suite
-
Range(代替计数器(index))
- length: end - start
- 范围: 包含start,不包含end
- 只有一个参数时,第一个参数为0
- [1:] 参数+: --> 最后一个参数到end
-
- 用递归compute,展开计算,递归返回底层结果。
-
reverse
- 抽象出共同特点作为扩展的case
-
recurse 从小到大递归,先找到base case(最大值),再递归到更小的case
- 将返回结果作为函数的参数
- recurse --> iteration:
- 将返回结果作为函数的参数
-
help function在外面能调用,里面省去了重复的参数。
-
sequence aggregation