3 ms·
Your example is not representative because you're using literals. Your actual example would be: "My name is {name}, I'm {feet} tall and live in {location}
by isaacremuant 7y ago
Your example is not representative because you're using literals.
Your actual example would be:
"My name is {name}, I'm {feet} tall and live in {location}.".format(name=name, location=location, feet=feet)
And with f-strings:
f"My name is {name}, I'm {feet} tall and live in {location}."
f-strings is clearly more readable, concise and actually faster to run.
- collyw 7y agoThe literals were just an example. And personally I find it more explicit, which is my original point. If its faster to run, then fair enough.