Back
Kindly refer to the below code for converting the string into list format:
text = 'a,b,c'text = text.split(',')text[ 'a', 'b', 'c' ]
text = 'a,b,c'
text = text.split(',')
text
[ 'a', 'b', 'c' ]
Or, you can also take the help of an in-built function in Python named eval():
text = 'a,b,c'text = eval('[' + text + ']')
text = eval('[' + text + ']')
For more information, you can refer to the following video:
31k questions
32.8k answers
501 comments
693 users