[Tutor] Conditional Statement without if statement?

Alex Kleider alexkleider at gmail.com
Tue Feb 8 14:14:44 EST 2022


(p10) alex at X1:~/Git/Club/Guides$ python
Python 3.10.0 (default, Nov 16 2021, 13:37:55) [GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 40 or 60
>>> x
40
>>>

l

> x = 42 or 66
>
> x will have the value 66
>
> To get that as a genuine boolean value (ie True or false) you
> need to call bool()
>
>


More information about the Tutor mailing list