📌  相关文章
📜  将字符串转换为列表 python 代码示例

📅  最后修改于: 2022-03-11 14:46:30.875000             🧑  作者: Mango

代码示例1
# To split the string at every character use the list() function
word = 'abc'
L = list(word)
L
# Output:
# ['a', 'b', 'c']

# To split the string at a specific character use the split() function
word = 'a,b,c'
L = word.split(',')
L
# Output:
# ['a', 'b', 'c']