[Solved] python — Converting a string into python list 2


For your input, you can strip the character '

>>> s[0].strip("'")
'UIS006538'
>>> [i.strip("'") for i in s]
['UIS006538']

You can alternatively use an eval to get all such strings

>>> [eval(i) for i in s]
['UIS006538']    

1

solved python — Converting a string into python list 2