Size: 141
Comment:
|
Size: 837
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
= 16. 函数编程 = == 16.3 重识列表过滤 == 1. `例16.7, (1)`:''odd uses the built-in mod function "%" to return `True` if n is odd and `False` if n is even.''[[BR]] odd 使用内建的取模(mod)函数 "%" 对于为奇数的 n 返回 `True`;为偶数的返回 `False`。[[BR]] (./) odd 使用内建的取模(mod)函数 "%" 对于为奇数的 n 返回 1;为偶数的返回 0。[[BR]] (!) 1 和 0 被 typo 为 True 和 False 是有原因的,你可以在修订历史里面找到。Mark 在 Dip 的早期版本中(那时 Python 还没有独立的 bool 类型)把 True, False 与 1, 0 都混用了,后来可能是用了盲目替换,自己都被弄懵了。 |
Include(../xbar) 以下是 Dip 原版的勘误。勘误表中指出的错误在 svn 版中均已修正。
16. 函数编程
16.3 重识列表过滤
例16.7, (1):odd uses the built-in mod function "%" to return True if n is odd and False if n is even.BR odd 使用内建的取模(mod)函数 "%" 对于为奇数的 n 返回 True;为偶数的返回 False。BR
odd 使用内建的取模(mod)函数 "%" 对于为奇数的 n 返回 1;为偶数的返回 0。BR
1 和 0 被 typo 为 True 和 False 是有原因的,你可以在修订历史里面找到。Mark 在 Dip 的早期版本中(那时 Python 还没有独立的 bool 类型)把 True, False 与 1, 0 都混用了,后来可能是用了盲目替换,自己都被弄懵了。