MRAB wrote:
Gary Herron wrote:
goldtech wrote:
Could you explain or link me to an explanation of this? Been using
Python for a while but not sure I understand what's happening below.
Thanks.
ss=1 and "f"
ss
'f'
ss=0 and "f"
ss
0
Python's Boole
MRAB wrote:
> Operation Result
>|x or y| x if x else y
>|x and y| y if x else x
>|not x| False if x else False
>
>:-)
>
That's not a terribly good definition for the 'not' operator. Try:
|not x| False if x else True
--
Duncan Booth http://kupuguy.blogspot.com
--
htt
On Aug 13, 8:36 pm, goldtech wrote:
> Could you explain or link me to an explanation of this?
http://docs.python.org/tutorial/datastructures.html#more-on-conditions
Give the whole tutorial a good read.
--
http://mail.python.org/mailman/listinfo/python-list
Gary Herron wrote:
goldtech wrote:
Could you explain or link me to an explanation of this? Been using
Python for a while but not sure I understand what's happening below.
Thanks.
ss=1 and "f"
ss
'f'
ss=0 and "f"
ss
0
Python's Boolean operators don't
>
> Could you explain or link me to an explanation of this? Been using
> Python for a while but not sure I understand what's happening below.
> Thanks.
>
> >>> ss=1 and "f"
> >>> ss
> 'f'
> >>> ss=0 and "f"
> >>> ss
> 0
> >>>
The "and" and "or" operators in Python are actually not tru
On Aug 13, 7:36 pm, goldtech wrote:
> Could you explain or link me to an explanation of this? Been using
> Python for a while but not sure I understand what's happening below.
> Thanks.
>
>
>
>
>
> >>> ss=1 and "f"
> >>> ss
> 'f'
> >>> ss=0 and "f"
> >>> ss
> 0
Does this help?
>>> s
goldtech wrote:
Could you explain or link me to an explanation of this? Been using
Python for a while but not sure I understand what's happening below.
Thanks.
ss=1 and "f"
ss
'f'
ss=0 and "f"
ss
0
Python's Boolean operators don't turn arbitrary valu
Could you explain or link me to an explanation of this? Been using
Python for a while but not sure I understand what's happening below.
Thanks.
>>> ss=1 and "f"
>>> ss
'f'
>>> ss=0 and "f"
>>> ss
0
>>>
--
http://mail.python.org/mailman/listinfo/python-list