方法1:直接通过加号操作符相加
代码如下:
foobar = 'foo' + 'bar'
list_of_strings = ['abc', 'def', 'ghi'] foobar = ''.join(list_of_strings)
foobar = '%s, %s' % ('abc', 'def')
希望本文所述对大家的python程序设计有所帮助。