str1 = ‘abc‘ str2 = ‘def‘ str3 = str1 + str2 print(str3)
这种方法只需要申请一次内存。
python 字符串拼接
原文:https://www.cnblogs.com/xiaozx/p/10468230.html