On Mon, May 23, 2016 at 1:47 AM, John Cremona <
john.c...@gmail.com> wrote:
> Are we not allowed to use
>
> print("x = %s" % x)
>
> any more?
It works fine in python3.
$ python3
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("x = %s" % 'john')
x = john
However, the new (?) format method on strings does in general tend to
lead to more readable and maintainable code. At least that was my
experience during the last three days, during which I wrote a large
amount of Python3 code.
--
William (
http://wstein.org)