Trying to choose between python and java

Alex Martelli aleax at mac.com
Mon Jul 16 01:28:08 EDT 2007


James T. Dennis <jadestar at idiom.com> wrote:
   ...
>  You can start writing all your code now as: print() --- calling
>  the statement as if it were a function.  Then you're future Python

...except that your output format will thereby become disgusting...:

>>> name = 'Alex'
>>> print 'Hello', name, 'and welcome to my program!'
Hello Alex and welcome to my program!
>>> print('Hello', name, 'and welcome to my program!')
('Hello', 'Alex', 'and welcome to my program!')

In Python 2.*, the parentheses will make a tuple, and so you'll get an
output full of parentheses, quotes and commas.  I think it's pretty bad
advice to give a newbie, to make his output as ugly as this.


Alex



More information about the Python-list mailing list