Answers for "List of strings to list of lists"

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
0

python list of list to list of string

list_of_string = [''.join(element) for element in list_of_list]
Posted by: Guest on June-02-2020

Code answers related to "List of strings to list of lists"

Python Answers by Framework

Browse Popular Code Answers by Language