On Wed, May 4, 2016, at 07:41 AM, Cai Gengyang wrote:
> I am trying to understand the boolean operator "and" in Python. It is
> supposed to return "True" when the expression on both sides of "and" are
> true
The thing is, its kinda dubious to think of 'and' as a 'boolean
operator', because once y
Cai Gengyang writes:
> Sorry I mistyped , this should be correct :
>
> bool_one = False and False --- This should give False because none of the
> statements are True
> bool_two = True and False --- This should give False because only 1 statement
> is True
> bool_three = False and True --- Thi
Sorry I mistyped , this should be correct :
bool_one = False and False --- This should give False because none of the
statements are True
bool_two = True and False --- This should give False because only 1 statement
is True
bool_three = False and True --- This should give False because only 1
Jussi Piitulainen writes:
> Cai Gengyang writes:
>
>> I am trying to understand the boolean operator "and" in Python. It is
>> supposed to return "True" when the expression on both sides of "and"
>> are true
>>
>> For instance,
>>
>> 1 < 3 and 10 < 20 is True --- (because both statements are true
Cai Gengyang writes:
> I am trying to understand the boolean operator "and" in Python. It is
> supposed to return "True" when the expression on both sides of "and"
> are true
>
> For instance,
>
> 1 < 3 and 10 < 20 is True --- (because both statements are true)
Yes.
> 1 < 5 and 5 > 12 is False -
On Thu, May 5, 2016 at 12:41 AM, Cai Gengyang wrote:
> I am trying to understand the boolean operator "and" in Python. It is
> supposed to return "True" when the expression on both sides of "and" are true
>
> For instance,
>
> 1 < 3 and 10 < 20 is True --- (because both statements are true)
> 1 <
On May 4, 2016 10:45 AM, "Cai Gengyang" wrote:
>
> I am trying to understand the boolean operator "and" in Python. It is
supposed to return "True" when the expression on both sides of "and" are
true
>
> For instance,
>
> 1 < 3 and 10 < 20 is True --- (because both statements are true)
> 1 < 5 and
On Wed, May 4, 2016 at 10:46 AM Cai Gengyang wrote:
> I am trying to understand the boolean operator "and" in Python. It is
> supposed to return "True" when the expression on both sides of "and" are
> true
>
Not exactly, because they will short-circuit. Take a look at the docs. (
https://docs.py
I am trying to understand the boolean operator "and" in Python. It is supposed
to return "True" when the expression on both sides of "and" are true
For instance,
1 < 3 and 10 < 20 is True --- (because both statements are true)
1 < 5 and 5 > 12 is False --- (because both statements are false)
b