+ 3

The usage of “or”. I cannot understand how this works...(python)

I can’t understand the following code: a = 5 or 7 print(a) #prints “5” b = 0 or 5 print(b) #prints “5” How does “or” work here? Thx!

4th Mar 2020, 12:41 AM
QWKKK
QWKKK - avatar
6 Answers
+ 3
Alexandr ThxAre there similar usages with “and”?
4th Mar 2020, 1:19 AM
QWKKK
QWKKK - avatar
+ 1
👍👍
4th Mar 2020, 1:36 AM
QWKKK
QWKKK - avatar
+ 1
~ swim ~ Thank you
4th Mar 2020, 9:28 AM
QWKKK
QWKKK - avatar
- 6
why are u wasting time doing this
4th Mar 2020, 8:40 AM
Ezequiel