News for hackers. Stuff that matters.
Re:Why Python 3 Exists by gluelogic on Thursday December 17, 2015 @12:02PM (#10752624)
The thing about the latter form is that you can do something like '{0} {1} {0} {2}'.format('apple', 'banana', 'orange') which results in 'apple banana apple orange'
Re:Why Python 3 Exists by squeaky-clean on Thursday December 17, 2015 @12:24PM (#10752790)
You can also use keyword arguments, which is really helpful in certain situation. Example from the docs:

  'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')
Re:Why Python 3 Exists by wyldfire on Thursday December 17, 2015 @12:38PM (#10752899)
You could do that before with % substitution too. But I prefer .format() because (1) it's the new idiom and (2) will coerce to string without me binding the type in the format string.