6 ms·
There's also strings. 'foo ' + bar 'foo {}'.format(bar) 'foo %s' % bar f'foo {bar}'
by strkek 9y ago
There's also strings.
'foo ' + bar
'foo {}'.format(bar)
'foo %s' % bar
f'foo {bar}'
- BerislavLopac 9y agoAs well as the string templates almost nobody knows about (https://docs.python.org/3.6/library/string.html#template-strings https://docs.python.org/3.6/library/string.html#template-str...): Template('$foo bar').substitute(foo='foo')