Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Python by (47.6k points)

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'?

1 Answer

0 votes
by (106k points)
edited by

By using the below-mentioned code you can convert string to a list:-

text = 'a,b,c' 

text = text.split(',') 



To know more about this you can have a look at the following video tutorial:-

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.7k users

Browse Categories