0

I am not sure how important is this question.

I saw for the first time the str % operator here in people's questions, as I didn't know it and always used str.format(), which was introduced in Python 2.6.

I.e.

'My age is {0}'.format(age)

vs

'My age is %d' % age
  • Is one of them considered as more standard than the other?
  • Does one of them work faster than the other?

Thanks!

Burkhard
  • 14,596
  • 22
  • 87
  • 108
SomethingSomething
  • 11,491
  • 17
  • 68
  • 126

0 Answers0