On 13/05/2013 22:51, Jim Mooney wrote:
I'm trying variable substitution in a format string that looks like one
that works, but I get an error. What am I doing wrong? tks
x = 40
s = 'John flew to the {0:-^{x}} yesterday'
print(s.format('moon', x))
Error is builtins.KeyError: 'x'
--
Jim
Using
On Mon, May 13, 2013 at 5:51 PM, Jim Mooney wrote:
> I'm trying variable substitution in a format string that looks like one that
> works, but I get an error. What am I doing wrong? tks
>
> x = 40
> s = 'John flew to the {0:-^{x}} yesterday'
> print(s.format('moon', x))
>
> Error is builtins.KeyEr
I'm trying variable substitution in a format string that looks like one
that works, but I get an error. What am I doing wrong? tks
x = 40
s = 'John flew to the {0:-^{x}} yesterday'
print(s.format('moon', x))
Error is builtins.KeyError: 'x'
--
Jim
___