切分,字符串转列表

a = "1,2,3,4,5,6,7,8"

b = a.split(",")
print(b)
print(type(b))
"""
['1', '2', '3', '4', '5', '6', '7', '8']
<class 'list'>
"""

  

posted @ 2019-11-26 23:29  real-admin  阅读(138)  评论(0编辑  收藏  举报