How to modify this from Python 2.x to v3.4?

jfong at ms4.hinet.net jfong at ms4.hinet.net
Sun Nov 12 04:02:58 EST 2017


Rick Johnson於 2017年11月12日星期日 UTC+8上午11時07分20秒寫道:
> `print` was changed from a statement to a function, so it's
> just a matter of converting it to a function call. If you
> read the docs for the new print function, it should be
> relatively easy to translate. I don't understand why you're
> having so much trouble.
> 
>     https://docs.python.org/3/whatsnew/3.0.html?highlight=print#common-stumbling-blocks

It's a shame I didn't read its doc in v3.4 thoughtfully:

    print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) 

I thought position argument is essential, but it's not in this function:

    If no objects are given, print() will just write end.

Thanks for your reminder.

--Jach



More information about the Python-list mailing list