Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

python convert string to list of dictionaries

import json

var = ["[{'Gfg' : 3, 'Best' : 8}, {'Gfg' : 4, 'Best' : 9}]"]
new_var = [json.loads(idx.replace("'", "'")) for idx in test_str]
 
PREVIOUS NEXT
Tagged: #python #convert #string #list #dictionaries
ADD COMMENT
Topic
Name
8+7 =