python 字符串转数组

str01 = "Thunder"
new_lits= list(str01)
print(new_list)

输出:["T",“h”,"u","n","d","e","r"]

2. 利用 split() 方法,把字符串以某种方式变成列表,如没有参数,默认为以空格区分每一个字符串元素并依次转换为列表元素:

s = '8, 3, 2, 7, 1'
l = s.split()
print(l)

输出:['8','3','2','7','1']