python字符串常用连接的方法:
1.使用“+”连接:
blog = ‘linuxinge‘ + ‘.blog‘ + ‘.51cto‘ + ‘.com‘
print blog
2.使用join
blog =[ ‘linuxinge‘,‘.blog‘ , ‘.51cto‘ , ‘.com‘]
print ‘‘.join(blog)
3.使用字符串格式化:
print ‘%s%s%s%s‘ % ( ‘linuxinge‘,‘.blog‘ , ‘.51cto‘ , ‘.com‘)
原文:http://linuxinge.blog.51cto.com/4604195/1718668