3 ms·
Let's concatenate strings. a + b f"{a}{b}" "".join([a, b]) "{}{}".format(a, b) If a == b, then you can also, which itself is a bit ridiculous: a *
by hawski 6y ago
Let's concatenate strings.
a + b
f"{a}{b}"
"".join([a, b])
"{}{}".format(a, b)
If a == b, then you can also, which itself is a bit ridiculous:
a * 2
Is mentioning StringIO considered cheating?
I would feel the Zen if Python would have a separate concatenation operator, it could be even the same for strings and lists. Lack of the operator in popular languages is my pet peeve.
- Izkata 6y agoYou forgot: "%s%s" % (a, b) (Still works at least as of python 3.6)