[Solved] beginners issue with using of lists in python


You can strip your elements with str.strip() method :

>>> l =["['lady']", "['hen']", "['horse']"]
>>> [i.strip("'][") for i in l]
['lady', 'hen', 'horse']

2

solved beginners issue with using of lists in python