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!