Currently I'm parsing a string using split
and returning the below
{fruit1:"Apple",fruit2:"Orange",fruit3:"Pear"}
I want to convert this string to json using json.loads
but I get the below error
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes
How would I go about adding double quotes to this string so I can perform the desired result below
food = '{"fruit1":"Apple","fruit2":"Orange","fruit3":"Pear"}'
print(food['fruit1'])
-----------
Apple