Python "why" questions

Default User hunguponcontent at gmail.com
Sat Aug 7 05:05:56 CEST 2010


>From "the emperor's new clothes" department:

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].

2)  In Python 3, why is print a function only, so that: print "Hello, World"
is not okay, but it must be print("Hello, World") instead?  (Yeah, I know:
picky, picky . . . )

3)  In Python 3, why does 2.0 / 3.0 display as 0.6666666666666666, but 8 *
3.57 displays as 28.56 (rounded off to 2 decimal places)?  And yet, in
Python 2.6, 8 * 3.57 displays as 28.559999999999999?

And we wonder why kids don't want to learn to program.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100806/f0afd1ea/attachment.html>


More information about the Python-list mailing list