Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 3
    I find this answer better, as adding the positional index for the placeholder makes the code more explicit, and easier to use. Especially if one has something like this: '{0[latitude]} {1[latitude]} {0[longitude]} {1[longitude]}'.format(geopoint0, geopoint1) Commented Sep 6, 2016 at 13:01
  • 1
    This is useful if you're using a defaultdict and don't have all the keys Commented Jan 9, 2017 at 17:12