On 29/06/2012 18:19, Josh English wrote:
On Friday, June 29, 2012 10:02:45 AM UTC-7, MRAB wrote:
The ".format" method accepts multiple arguments, so the placeholders in
the format string need to specify which argument to format as well as
how to format it (the format specification after the ":"
On Friday, June 29, 2012 10:08:20 AM UTC-7, Steven D'Aprano wrote:
> c = (1,3)
> s = "{0[0]}"
> print s.format(c)
> > '1'
>
> That's not actually the output copied and pasted. You have quotes around
> the string, which you don't get if you pass it to the print command.
>
Mea culp
On Friday, June 29, 2012 10:02:45 AM UTC-7, MRAB wrote:
>
> The ".format" method accepts multiple arguments, so the placeholders in
> the format string need to specify which argument to format as well as
> how to format it (the format specification after the ":").
>
> The "format" function, on th
On Fri, 29 Jun 2012 09:31:53 -0700, Josh English wrote:
> I have a list of tuples, and usually print them using:
>
> print c, " ".join(map(str, list_of_tuples))
>
> This is beginning to feel clunky (but gives me essentially what I want),
> and I thought there was a better, more concise, way to a
On 29/06/2012 17:31, Josh English wrote:
I have a list of tuples, and usually print them using:
print c, " ".join(map(str, list_of_tuples))
This is beginning to feel clunky (but gives me essentially what I want), and I
thought there was a better, more concise, way to achieve this, so I explore