Re: I have tried and errored a reasonable amount of times

2014-09-05 Thread Marko Rauhamaa
Grant Edwards : > Who uses + for disjunction (∨ OR) and concatenation for > conjunction (∧ AND)? That's crazy notation. > > AFAIK, that's the standard notation in both CS and EE university > classes in the US also: + for 'or' and dot or abuttal for 'and'. Besides, it's no crazier for Bool

Re: I have tried and errored a reasonable amount of times

2014-09-05 Thread Grant Edwards
On 2014-09-05, Denis McMahon wrote: > On Thu, 04 Sep 2014 21:42:56 +1000, Chris Angelico wrote: >> On Thu, Sep 4, 2014 at 9:17 PM, Denis McMahon >> wrote: >>> On Wed, 03 Sep 2014 07:16:34 +, Steven D'Aprano wrote: >>> Who uses + for disjunction (∨ OR) and concatenation for conjunction >

Re: I have tried and errored a reasonable amount of times

2014-09-04 Thread Chris Angelico
On Fri, Sep 5, 2014 at 12:53 PM, Denis McMahon wrote: > On Thu, 04 Sep 2014 21:42:56 +1000, Chris Angelico wrote: > >> On Thu, Sep 4, 2014 at 9:17 PM, Denis McMahon >> wrote: >>> On Wed, 03 Sep 2014 07:16:34 +, Steven D'Aprano wrote: >>> Who uses + for disjunction (∨ OR) and concatenatio

Re: I have tried and errored a reasonable amount of times

2014-09-04 Thread Denis McMahon
On Thu, 04 Sep 2014 21:42:56 +1000, Chris Angelico wrote: > On Thu, Sep 4, 2014 at 9:17 PM, Denis McMahon > wrote: >> On Wed, 03 Sep 2014 07:16:34 +, Steven D'Aprano wrote: >> >>> Who uses + for disjunction (∨ OR) and concatenation for conjunction (∧ >>> AND)? That's crazy notation. >> >> The

Re: I have tried and errored a reasonable amount of times

2014-09-04 Thread Chris Angelico
On Thu, Sep 4, 2014 at 9:17 PM, Denis McMahon wrote: > On Wed, 03 Sep 2014 07:16:34 +, Steven D'Aprano wrote: > >> Who uses + for disjunction (∨ OR) and concatenation for conjunction (∧ >> AND)? That's crazy notation. > > The way I was taught it in the mid 1980s, a.b === a and b, a+b === a or

Re: I have tried and errored a reasonable amount of times

2014-09-04 Thread Denis McMahon
On Wed, 03 Sep 2014 07:16:34 +, Steven D'Aprano wrote: > Who uses + for disjunction (∨ OR) and concatenation for conjunction (∧ > AND)? That's crazy notation. The way I was taught it in the mid 1980s, a.b === a and b, a+b === a or b. -- Denis McMahon, denismfmcma...@gmail.com -- https://ma

Re: I have tried and errored a reasonable amount of times

2014-09-03 Thread Marko Rauhamaa
Steven D'Aprano : > Marko Rauhamaa wrote: >> That's the classic Boolean algebraic notation. > > Says who? (Apart from you, obviously :-) Since when? I've never seen > it in *any* discussion of Boolean algebra. I have only run into George Boole, Boolean algebra and booleans in engineering textboo

Re: I have tried and errored a reasonable amount of times

2014-09-03 Thread Rustom Mody
On Thursday, September 4, 2014 7:24:19 AM UTC+5:30, Steven D'Aprano wrote: > Marko Rauhamaa wrote: > > Steven D'Aprano: > >> Who uses + for disjunction (∨ OR) and concatenation for conjunction (∧ > >> AND)? That's crazy notation. > > That's the classic Boolean algebraic notation. > Says who? (Ap

Re: I have tried and errored a reasonable amount of times

2014-09-03 Thread Chris Angelico
On Thu, Sep 4, 2014 at 11:54 AM, Steven D'Aprano wrote: > although the > analogy is terrible for ∨. 1+1 = 2, not 1. I wouldn't say terrible. Unclear perhaps, but functional. Try this exercise: false, true = 0, 1 # or use an old Python if true + true: print("true OR true is true") As long as

Re: I have tried and errored a reasonable amount of times

2014-09-03 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Steven D'Aprano : > >> Who uses + for disjunction (∨ OR) and concatenation for conjunction (∧ >> AND)? That's crazy notation. > > That's the classic Boolean algebraic notation. Says who? (Apart from you, obviously :-) Since when? I've never seen it in *any* discussion o

Re: I have tried and errored a reasonable amount of times

2014-09-03 Thread Marko Rauhamaa
Steven D'Aprano : > Who uses + for disjunction (∨ OR) and concatenation for conjunction (∧ > AND)? That's crazy notation. That's the classic Boolean algebraic notation. In basic algebra, the two interesting operations are "addition" and "multiplication". Boolean math works like elementary arithme

Re: I have tried and errored a reasonable amount of times

2014-09-03 Thread Steven D'Aprano
On Tue, 02 Sep 2014 20:14:51 -0700, Rustom Mody wrote: > Dijkstra > used to point out > > A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C) A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C) look > normal enough in this form > > Put then into the way engineers do it and they become A(B + C) = AB + AC > A + BC = (A+B)(A+C) o_O Who

Re: I have tried and errored a reasonable amount of times

2014-09-02 Thread Rustom Mody
On Wednesday, September 3, 2014 7:14:14 AM UTC+5:30, Steven D'Aprano wrote: > Grant Edwards wrote: > > I missed the beginning of the thread, but Why are you comparing things > > to True and False? > I don't understand why people do it, but it's *incredibly* common. A couple > of weeks ago at work

Re: I have tried and errored a reasonable amount of times

2014-09-02 Thread Steven D'Aprano
Grant Edwards wrote: > I missed the beginning of the thread, but Why are you comparing things > to True and False? I don't understand why people do it, but it's *incredibly* common. A couple of weeks ago at work, I had to (gently, in a friendly manner) mock one of our most senior and accomplished

Re: I have tried and errored a reasonable amount of times

2014-09-02 Thread Seymore4Head
On Tue, 2 Sep 2014 16:43:09 + (UTC), Grant Edwards wrote: >On 2014-08-30, Tim Chase wrote: >> On 2014-08-30 14:27, Seymore4Head wrote: >>> I really tried to get this without asking for help. >>> >>> mylist = ["The", "earth", "Revolves", "around", "Sun"] >>> print (mylist) >>> for e in mylis

Re: I have tried and errored a reasonable amount of times

2014-09-02 Thread Grant Edwards
On 2014-08-30, Tim Chase wrote: > On 2014-08-30 14:27, Seymore4Head wrote: >> I really tried to get this without asking for help. >> >> mylist = ["The", "earth", "Revolves", "around", "Sun"] >> print (mylist) >> for e in mylist: >> >> # one of these two choices should print something. Since ne

Re: I have tried and errored a reasonable amount of times

2014-08-31 Thread Chris Angelico
On Sun, Aug 31, 2014 at 6:37 PM, Steven D'Aprano wrote: > - Use print() to see the intermediate results: > > a = e[0].isupper > print(e[0], a, a == False, a == True) And I'll add to this: *Copy and paste* the original code to craft this output statement. I recently was trying to figure ou

Re: I have tried and errored a reasonable amount of times

2014-08-31 Thread Steven D'Aprano
Seymore4Head wrote: > That would work now, but I didn't even know no.isupper() was command > until 15 min ago.  :) > > I have been told that one is a method and the other calls a method.  I > still have to learn exactly what that means.  I'm getting there. Indeed you are :-) "Command", in Pytho

Re: I have tried and errored a reasonable amount of times

2014-08-31 Thread Steven D'Aprano
For future reference, here is a hint as to how to debug problems like this, and a cleaner way to write the code. Seymore4Head wrote: > On Sat, 30 Aug 2014 13:48:09 -0500, Tim Chase > wrote: >>> if e[0].isupper == False: >>> print ("False") >>> if e[0].isupper == True: >>>

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Cameron Simpson
On 30Aug2014 17:48, Seymore4Head wrote: I have been told that one is a method and the other calls a method. I still have to learn exactly what that means. I'm getting there. A method is, essentially, a function. Observe: def my_func(x): print(9) my_func is just the name of the functi

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Mark Lawrence
On 30/08/2014 22:48, Seymore4Head wrote: On Sat, 30 Aug 2014 22:21:40 +0100, Mark Lawrence wrote: On 30/08/2014 19:48, Tim Chase wrote: On 2014-08-30 14:27, Seymore4Head wrote: I really tried to get this without asking for help. mylist = ["The", "earth", "Revolves", "around", "Sun"] print (

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Seymore4Head
On Sat, 30 Aug 2014 22:21:40 +0100, Mark Lawrence wrote: >On 30/08/2014 19:48, Tim Chase wrote: >> On 2014-08-30 14:27, Seymore4Head wrote: >>> I really tried to get this without asking for help. >>> >>> mylist = ["The", "earth", "Revolves", "around", "Sun"] >>> print (mylist) >>> for e in mylist

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Mark Lawrence
On 30/08/2014 19:48, Tim Chase wrote: On 2014-08-30 14:27, Seymore4Head wrote: I really tried to get this without asking for help. mylist = ["The", "earth", "Revolves", "around", "Sun"] print (mylist) for e in mylist: # one of these two choices should print something. Since neither does, I

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Seymore4Head
On Sat, 30 Aug 2014 16:20:56 -0400, Ned Batchelder wrote: >On 8/30/14 2:50 PM, Seymore4Head wrote: >> On Sat, 30 Aug 2014 13:48:09 -0500, Tim Chase >> wrote: >> >>> On 2014-08-30 14:27, Seymore4Head wrote: I really tried to get this without asking for help. mylist = ["The", "earth

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Ned Batchelder
On 8/30/14 2:50 PM, Seymore4Head wrote: On Sat, 30 Aug 2014 13:48:09 -0500, Tim Chase wrote: On 2014-08-30 14:27, Seymore4Head wrote: I really tried to get this without asking for help. mylist = ["The", "earth", "Revolves", "around", "Sun"] print (mylist) for e in mylist: # one of these t

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Seymore4Head
On Sat, 30 Aug 2014 13:48:09 -0500, Tim Chase wrote: >On 2014-08-30 14:27, Seymore4Head wrote: >> I really tried to get this without asking for help. >> >> mylist = ["The", "earth", "Revolves", "around", "Sun"] >> print (mylist) >> for e in mylist: >> >> # one of these two choices should print

Re: I have tried and errored a reasonable amount of times

2014-08-30 Thread Tim Chase
On 2014-08-30 14:27, Seymore4Head wrote: > I really tried to get this without asking for help. > > mylist = ["The", "earth", "Revolves", "around", "Sun"] > print (mylist) > for e in mylist: > > # one of these two choices should print something. Since neither > does, I am missing something subtl

I have tried and errored a reasonable amount of times

2014-08-30 Thread Seymore4Head
I really tried to get this without asking for help. mylist = ["The", "earth", "Revolves", "around", "Sun"] print (mylist) for e in mylist: # one of these two choices should print something. Since neither does, I am missing something subtle. if e[0].isupper == False: print ("False