逻辑判断

>>> 1 or 2
1
>>> -1 or 3
-1
>>> 0 or -1
-1
>>> 0 or 100
100
>>> '' or 10
10
>>> 's' or 0
's'
>>> 'a' or 'b'
'a'
>>> 4 and 8
8
>>> 0 and 6
0
>>> -1 and 88
88
>>> '' and 7
''
>>> 's' and ''
''
>>> '' and 0
''
>>> 6 or 2>1
6
>>> 2>1
True
>>> 0 or 5<4
False>>> 1 or 2
1
>>> -1 or 3
-1
>>> 0 or -1
-1
>>> 0 or 100
100
>>> '' or 10
10
>>> 's' or 0
's'
>>> 'a' or 'b'
'a'
>>> 4 and 8
8
>>> 0 and 6
0
>>> -1 and 88
88
>>> '' and 7
''
>>> 's' and ''
''
>>> '' and 0
''
>>> 6 or 2>1
6
>>> 2>1
True
>>> 0 or 5<4
False

  

posted @ 2023-05-06 12:39  sangern  阅读(17)  评论(0编辑  收藏  举报