how can i convert a string in a list to a list?

You ca do this,

l =['[37i9dQZF1DX5, 37i9dQZF1DWTR, 37i9dQZF1DX0s5]']
l2 = l[0].replace("[","").replace("]","").split(", ")

Which will give you the following as the content of l2

['37i9dQZF1DX5', '37i9dQZF1DWTR', '37i9dQZF1DX0s5']

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top