Python 5种连接字符串的方法
2017-12-20 19:48
274 查看
Python 5种连接字符串的方法
Talk is cheap, please show me the code.print('python' 'best') #使用空格 print('python' + 'best') #使用+号 print('python', 'best') #使用,号 注意会有空格 str_list = ['python', 'best'] #使用空字符串join str = '' print(str.join(str_list)) str_list = ['python', 'best'] #使用空格join str = ' ' print(str.join(str_list)) print('%s %s' %('python', 'best')) #格式化输出 这个简直是凑数的=.= #结果 pythonbest pythonbest python best pythonbest python best python best
相关文章推荐
- Python字符串连接的5种方法
- Python字符串连接的5种方法
- Python字符串连接的5种方法
- 【Python那些事儿】Python字符串连接的5种方法
- Python中字符串连接的5种方法
- python字符串连接方法分析
- python连接字符串的方法小结
- python 将列表中的字符串连接成一个长路径的方法
- python字符串连接方法
- Python字符串连接方法
- python字符串连接方法分析
- python字符串连接的三种方法及其效率、适用场景详解
- Python字符串类型(创建、索引、切片、成员操作符、重复、连接、计算长度、内置方法)
- 字符串连接的5种方法
- python字符串过滤性能比较5种方法
- python list 合并连接字符串的方法
- 简单总结Python中几种字符串连接的方法
- Python学习笔记--Python字符串连接方法总结
- python中数字和字符串连接的两种方法
- python字符串连接的三种方法及其效率、适用场景详解