Newcomer struggling with tutorial

Dave Harrison dave at nullcube.com
Sat Oct 4 23:33:27 EDT 2003


> a = -1
> b = 77
> c =  1
> 
> (a < b)
>  True
> 
> True == c
>  True
> 
> (a < b) == c
>  False
> 
> Unfortunately I was brought up with the belief that if A == B and B == C, 
> then A should == C.
> 
> I confess that after two hours worrying about this I have given up on 
> Python and uninstalled it. A shame: it looked so good!

well isnt that the defeatist way to go.

sounds like you're trying to compare two values that are not necessarily
the same.  You're thinking in boolean logic, and trying to express it in
a totally different way.

You wanted :

a = 1
b = 2
c = 1
print ((a<2) & c)

So we are saying we want to have BOTH (a<2) AND (c) to be true.

Dave





More information about the Python-list mailing list