Exercise_6
Exercise 6 : Operators
Test :
floor 除法 : 返回最近的整数
3.0 // 2.0 #1.0
a < b < c 等价于 a < b and b < c
5 ** -2 #0.04
not 1 or 0 and 1 or 3 and 4 or 5 and 6 or 7 and 8 and 9
4 (preference : not > and > or )
and 和 or 均返回决定表达式结果的值
x and y ,x 为真,返回y;x为假,返回x
x or y, x为真,返回x;x为假,返回y
not x , x为真,返回False;x为假,返回True
Try :
100以内的奇数:
1 |
|
中国剩余定理问题 :
1 |
|
1 |
|
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!