On Wed, Sep 27, 2017 at 5:21 AM, Cai Gengyang wrote:
> On Wednesday, September 27, 2017 at 1:01:50 PM UTC+8, Cameron Simpson
> wrote:
> > On 26Sep2017 20:55, Cai Gengyang wrote:
> > >On Wednesday, September 27, 2017 at 6:45:00 AM UTC+8, Cameron Simpson
> wrote:
> > >> On 26Sep2017 14:43, Cai Gen
On Wednesday, September 27, 2017 at 1:01:50 PM UTC+8, Cameron Simpson wrote:
> On 26Sep2017 20:55, Cai Gengyang wrote:
> >On Wednesday, September 27, 2017 at 6:45:00 AM UTC+8, Cameron Simpson wrote:
> >> On 26Sep2017 14:43, Cai Gengyang wrote:
> >> >C) Set bool_three equal to the result of
> >> >
On 26Sep2017 20:55, Cai Gengyang wrote:
On Wednesday, September 27, 2017 at 6:45:00 AM UTC+8, Cameron Simpson wrote:
On 26Sep2017 14:43, Cai Gengyang wrote:
>C) Set bool_three equal to the result of
>19 % 4 != 300 / 10 / 10 and False
>
19 % 4 = 3 which is equal to 300 / 10 / 10 = 3, hence the
Cai Gengyang wrote:
So does that mean that the way 'and' works in Python is that both terms must
be True (1) for the entire expression to be True ? Why is it defined that
way, weird ?
It's not weird, it's the normal meaning of "and" in English.
Do I have purple hair? No.
Do I have three nostri
On Wednesday, September 27, 2017 at 6:45:00 AM UTC+8, Cameron Simpson wrote:
> On 26Sep2017 14:43, Cai Gengyang wrote:
> >Help check if my logic is correct in all 5 expressions
>
> Why not just run some code interactively? Unless this is entirely a thought
> exercise to verify that you have a so
On Wed, 27 Sep 2017 08:23 am, Cai Gengyang wrote:
>
> I'm trying to understand the logic behind AND. I looked up Python logic tables
>
> False and False gives False
> False and True gives False
> True and False gives False
> True and True gives True.
>
> So does that mean that the way 'and' wor
On 27/09/17 00:23, Cai Gengyang wrote:
> I'm trying to understand the logic behind AND. I looked up Python logic tables
>
> False and False gives False
> False and True gives False
> True and False gives False
> True and True gives True.
>
> So does that mean that the way 'and' works in Python is t
>
> On Sep 26, 2017, at 3:23 PM, Cai Gengyang wrote:
>
>
> I'm trying to understand the logic behind AND. I looked up Python logic tables
>
> False and False gives False
> False and True gives False
> True and False gives False
> True and True gives True.
>
> So does that mean that the way 'a
On 09/27/2017 12:23 AM, Cai Gengyang wrote:
>
> I'm trying to understand the logic behind AND. I looked up Python logic tables
>
> False and False gives False
> False and True gives False
> True and False gives False
> True and True gives True.
>
> So does that mean that the way 'and' works in P
On 26Sep2017 15:23, Cai Gengyang wrote:
I'm trying to understand the logic behind AND. I looked up Python logic tables
False and False gives False
False and True gives False
True and False gives False
True and True gives True.
So does that mean that the way 'and' works in Python is that both
On 26Sep2017 14:43, Cai Gengyang wrote:
Help check if my logic is correct in all 5 expressions
Why not just run some code interactively? Unless this is entirely a thought
exercise to verify that you have a solid mental understanding of Python
semantics, all your reasoning is easy to test.
On 09/26/2017 03:23 PM, Cai Gengyang wrote:
I'm trying to understand the logic behind AND. I looked up Python logic tables
False and False gives False
False and True gives False
True and False gives False
True and True gives True.
So does that mean that the way 'and' works in Python is that bo
I'm trying to understand the logic behind AND. I looked up Python logic tables
False and False gives False
False and True gives False
True and False gives False
True and True gives True.
So does that mean that the way 'and' works in Python is that both terms must be
True (1) for the entire expr
On Tuesday, September 26, 2017 at 2:54:32 PM UTC-7, Chris Angelico wrote:
> On Wed, Sep 27, 2017 at 7:43 AM, Cai Gengyang wrote:
> > Help check if my logic is correct in all 5 expressions
> >
> >
> > A) Set bool_one equal to the result of
> > False and False
> >
> > Entire Expression : False and F
On Wed, Sep 27, 2017 at 7:43 AM, Cai Gengyang wrote:
> Help check if my logic is correct in all 5 expressions
>
>
> A) Set bool_one equal to the result of
> False and False
>
> Entire Expression : False and False gives True because both are False
This is not correct, and comes from a confusion in
Help check if my logic is correct in all 5 expressions
A) Set bool_one equal to the result of
False and False
Entire Expression : False and False gives True because both are False
B) Set bool_two equal to the result of
-(-(-(-2))) == -2 and 4 >= 16 ** 0.5
-(-(-(-2))) is equal to 2, and 2 i
Steven D'Aprano writes:
> On Wed, 17 Apr 2013 11:47:49 +0300, Jussi Piitulainen wrote:
>
> > Steven D'Aprano writes:
> >
> >> So paradoxically, that means that "x or y" counts as an and_test
> >> (obviously!) but also as an or_test, since every and_test also counts
> >> as an or_test. Here's so
On Wed, 17 Apr 2013 11:47:49 +0300, Jussi Piitulainen wrote:
> Steven D'Aprano writes:
>
>> So paradoxically, that means that "x or y" counts as an and_test
>> (obviously!) but also as an or_test, since every and_test also counts
>> as an or_test. Here's some crappy ASCII art of a Venn diagram
>
Steven D'Aprano writes:
> So paradoxically, that means that "x or y" counts as an and_test
> (obviously!) but also as an or_test, since every and_test also
> counts as an or_test. Here's some crappy ASCII art of a Venn diagram
I think you mean to say that "x and y" counts as an and_test and also
On Tue, 16 Apr 2013 15:19:25 -0700, Bruce McGoveran wrote:
> Hello. I am new to this group. I've done a search for the topic about
> which I'm posting, and while I have found some threads that are
> relevant, I haven't found anything exactly on point that I can
> understand. So, I'm taking the
Thank you all for thoughts. I'm just about to post another question about
atoms and primaries. If you have a moment to look it over, I would appreciate
your thoughts.
Many thanks in advance.
On Tuesday, April 16, 2013 6:19:25 PM UTC-4, Bruce McGoveran wrote:
> Hello. I am new to this group.
[2nd try, quotation a bit messed up]
On 4/16/2013 6:19 PM, Bruce McGoveran wrote:
> Hello. I am new to this group. I've done a search for the topic
> about which I'm posting, and while I have found some threads that are
> relevant, I haven't found anything exactly on point that I can
> underst
On Tue, 16 Apr 2013 23:19:25 +0100, Bruce McGoveran
wrote:
Hello. I am new to this group. I've done a search for the topic about
which I'm posting, and while I have found some threads that are
relevant, I haven't found anything exactly on point that I can
understand. So, I'm taking the
On 04/16/2013 06:19 PM, Bruce McGoveran wrote:
Hello. I am new to this group. I've done a search for the topic about which
I'm posting, and while I have found some threads that are relevant, I haven't
found anything exactly on point that I can understand. So, I'm taking the
liberty of askin
On Tue, 16 Apr 2013 15:19:25 -0700, Bruce McGoveran wrote:
> Hello. I am new to this group. I've done a search for the topic about
> which I'm posting, and while I have found some threads that are
> relevant, I haven't found anything exactly on point that I can
> understand. So, I'm taking the
Hello. I am new to this group. I've done a search for the topic about which
I'm posting, and while I have found some threads that are relevant, I haven't
found anything exactly on point that I can understand. So, I'm taking the
liberty of asking about something that may be obvious to many rea
Gustavo Narea writes:
> Hello, everybody.
>
> I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and
> (bar > 2 or bar == 0)" which are defined as strings (in a database or
> a plain text file, for example). How would you achieve th
Thank you very much, Gabriela and Peter!
I'm going for Pyparsing. :)
-- Gustavo.
--
http://mail.python.org/mailman/listinfo/python-list
Gustavo Narea wrote:
> I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and
> (bar > 2 or bar == 0)" which are defined as strings (in a database or
> a plain text file, for example). How would you achieve this?
>
> These expressions will c
En Mon, 27 Apr 2009 14:03:01 -0300, Gustavo Narea
escribió:
I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and
(bar > 2 or bar == 0)" which are defined as strings (in a database or
a plain text file, for example). How would you achieve this?
This
Hello, everybody.
I need to evaluate boolean expressions like "foo == 1" or "foo ==1 and
(bar > 2 or bar == 0)" which are defined as strings (in a database or
a plain text file, for example). How would you achieve this?
These expressions will contain placeholders for Py
31 matches
Mail list logo