如何将字符串转换为列表?
说字符串就像text = "a,b,c". 转换后,text == ['a', 'b', 'c']希望?text[0] == 'a'``text[1] == 'b'
text = "a,b,c"
text == ['a', 'b', 'c']
text[0] == 'a'``text[1] == 'b'
像这样:
>>> text = 'a,b,c' >>> text = text.split(',') >>> text [ 'a', 'b', 'c' ]