Re: Conditionals And Control Flows

2016-05-04 Thread Stephen Hansen
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

Re: Conditionals And Control Flows

2016-05-04 Thread Jussi Piitulainen
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

Re: Conditionals And Control Flows

2016-05-04 Thread Cai Gengyang
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

Re: Conditionals And Control Flows

2016-05-04 Thread Ben Bacarisse
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

Re: Conditionals And Control Flows

2016-05-04 Thread Jussi Piitulainen
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 -

Re: Conditionals And Control Flows

2016-05-04 Thread Chris Angelico
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 <

Re: Conditionals And Control Flows

2016-05-04 Thread Bob Gailer
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

Re: Conditionals And Control Flows

2016-05-04 Thread Michael Selik
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

Conditionals And Control Flows

2016-05-04 Thread Cai Gengyang
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