Write a Python program to demonstrate to convert list of string to list of list


Topic: Write a Python program to demonstrate to convert list of string to list of list

Solution

test_list = [ '[1, 4, 5]', '[4, 6, 8]' ] 
print (f"The original list is : {test_list}") 
res = [i.strip("[]").split(", ") for i in test_list] 
print (f"The list after conversion is : {res}") 



List all Python Programs