2 ms·
You can also use keyword arguments, which is really helpful in certain situation. Example from the docs: 'Coordinates: {latitude}, {longitude}'.format(latitu
by squeaky-clean 11y ago
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')
- wyldfire 11y agoYou 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.