>>> True == 1
True
>>> False == 0
True
>>> int(True)
1
>>> int(False)
0
>>> bool(1)
True
>>> bool(0)
False
But:
str(fill==True)+','
is simpler than:
("False,", "True,")[fill==True]
--
http://mail.python.org/mailman/listinfo/python-list
> > 1) Why do Python lists start with element [0], instead of element
> > [1]? "Common sense" would seem to suggest that lists should start
> > with [1].
Because Zero is the neutral element of addition operation. And indexes
(and all adresses in computing) involve with addition much more than
On Aug 9, 3:41 pm, "saeed.gnu" wrote:
> "x is y" means "id(y) == id(y)"
> "x is not y" means "id(x) != id(x)"
> "x is not None" means "id(x) != id(None)"
>
> "x is not None" is a
"x is y" means "id(y) == id(y)"
"x is not y" means "id(x) != id(x)"
"x is not None" means "id(x) != id(None)"
"x is not None" is a really silly statement!! because id(None) and id
of any constant object is not predictable! I don't know whay people
use "is" instead of "==". y
I recommend to use UTF-8 coding(specially in GNU/Linux) then write
this in the second line:
#-*- coding: latin-1 -*-
--
http://mail.python.org/mailman/listinfo/python-list