1. 字符串转列表
str1 = "Hi hello world" print(str1.split(" ")) 输出: ['Hi', 'hello', 'world']
2. 列表转字符串
l = ["Hi","hello","world"] print(" ".join(l)) 输出: Hi hello world
str1 = "Hi hello world" print(str1.split(" ")) 输出: ['Hi', 'hello', 'world']
l = ["Hi","hello","world"] print(" ".join(l)) 输出: Hi hello world