Hi everyone,
I'm still stuck trying to get a working function to iterate through a chunk of json, and add the relevant keys/values to a list or dictionary to be searched/referenced later. From a previous topic I posted, I got a pretty good idea of what I have to do, but I'm having a hard time getting it to work.
Here's some example json:
I'm still stuck trying to get a working function to iterate through a chunk of json, and add the relevant keys/values to a list or dictionary to be searched/referenced later. From a previous topic I posted, I got a pretty good idea of what I have to do, but I'm having a hard time getting it to work.
Here's some example json:
[{'color': 'purple', 'flavor': 'plum', 'code': 3489, 'instock': 'yes'}] ... ... [{'color': 'red', 'flavor': 'cherry', 'code': 3327, 'instock': 'yes'}]In the above example, let's assume there are 100's of lines for different candies... but I only want to pull the "code" (unique id) and "instock" key/values for each line, and store them into a dictionary to be used/referenced later on.