3 ms·
To be fair, that's not quite the same as perl/shell-style interpolation. In perl, "$x" pulls the value of $x from the variable namespace. In your Py2.6 example
by iclelland 17y ago
To be fair, that's not quite the same as perl/shell-style interpolation.
In perl, "$x" pulls the value of $x from the variable namespace. In your Py2.6 example, the "{x}" format in the string has nothing to do with a variable named x; rather it references the keyword args supplied to format.
To simulate perl's
print "x: $x";
you would
print "x: {x}".format(x=x)