Python "why" questions

Vito 'ZeD' De Tullio zak.mc.kraken at libero.it
Sat Aug 7 05:46:23 CEST 2010


Default User wrote:

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

http://userweb.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

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

"There should be one-- and preferably only one --obvious way to do it."

> 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?

http://mail.python.org/pipermail/python-dev/2009-October/092958.html

and replies

-- 
By ZeD




More information about the Python-list mailing list