Answers for "convert list items into list of strings python"

2

convert all items in list to string python

mylist = [str(i) for i in mylist]
Posted by: Guest on January-18-2021
1

python string list to list

>>> import ast
>>> x = '[ "A","B","C" , " D"]'
>>> x = ast.literal_eval(x)
>>> x
['A', 'B', 'C', ' D']
>>> x = [n.strip() for n in x]
>>> x
['A', 'B', 'C', 'D']
Posted by: Guest on May-06-2021

Code answers related to "convert list items into list of strings python"

Python Answers by Framework

Browse Popular Code Answers by Language