python字符串拼接顺序从快到慢

s1 = 'Hello'
s2 = 'Python'

f'{s1} {s2}'#fast,f-string

s1 + ' ' + s2

' '.join(s1, s2)

'%s %s' % (s1, s2)

'{} {}'.format(s1, s2)

Template('$s1 $s2').substitute(s1=s1, s2=s2)#low

原文地址:https://www.cnblogs.com/zxfei/p/14508476.html