本文转载自:
http://www.cnblogs.com/wills666/p/7007740.html 作者:wills666 转载请注明该声明。
学习内容:
1.字符串转列表
2.列表转字符串
1. 字符串转列表
str1 = "hi hello world" print(str1.split(" "))
输出:
['hi', 'hello', 'world']
2. 列表转字符串
l = ["hi","hello","world"] print(" ".join(l))
输出:
hi hello world