So I am working on learning Python and have a project I am working on involving keeping track of vending machines. I was given JSON files to get the information I need, but I don't know how to read it in. My teacher said it is formatted to be read in easily with every vending machine slot as a dictionary but I am very unfamiliar with dictionaries and don't understand how to do it. If someone could quickly give me an example of how to read this in I would really appreciate it because I really don't even understand where to start.
Here is a section of the JSON file:
{
"contents": [
{
"row": "A",
"slots": [
{
"current_stock": 2,
"item_name": "Coke",
"item_price": 1.75,
"last_stock": 3,
"slot_number": 1
},
{
"current_stock": 0,
"item_name": "Coke",
"item_price": 1.75,
"last_stock": 6,
"slot_number": 2
},
{
"current_stock": 1,
"item_name": "Coke",
"item_price": 1.75,
"last_stock": 2,
"slot_number": 3
},
{
"current_stock": 3,
"item_name": "Coke",
"item_price": 1.75,
"last_stock": 3,
"slot_number": 4
},
{
"current_stock": 2,
"item_name": "Coke",
"item_price": 1.75,
"last_stock": 2,
"slot_number": 5
},
{
"current_stock": 0,
"item_name": "Coke",
"item_price": 1.75,
"last_stock": 5,
"slot_number": 6
},
{
"current_stock": 6,
"item_name": "Coke Zero",
"item_price": 1.75,
"last_stock": 8,
"slot_number": 7
},
{
"current_stock": 2,
"item_name": "Coke Zero",
"item_price": 1.75,
"last_stock": 4,
"slot_number": 8
},
{
"current_stock": 4,
"item_name": "Coke Zero",
"item_price": 1.75,
"last_stock": 7,
"slot_number": 9
}
]
},