Back
How do you convert a string into a list?
Say the string is like text = "a,b,c". After the conversion, text == ['a', 'b', 'c'] and hopefully text[0] == 'a', text[1] == 'b'?
By using the below-mentioned code you can convert string to a list:-
text = 'a,b,c' text = text.split(',') print(text)
text = 'a,b,c'
text = text.split(',')
print(text)
To know more about this you can have a look at the following video tutorial:-
31k questions
32.8k answers
501 comments
693 users