0

What is the difference between this "Old" type of formatting and the "New" type of formatting?

New: '%s %s' % ('one', 'two')

Old: '{} {}'.format('one', 'two')

Can someone explain this to me? Every example I've tried has given me the same result regardless of either formatting option. Is this just for personal preference? If so that seems kind of wasteful?

EDIT: also what is this? f'{one} {two}' as mentioned in the comments....

Max Bethke
  • 286
  • 1
  • 2
  • 18

0 Answers0