Learning some more programming lately

Been taking some time off of art to learn some Python. Mixing some Json and Python creates a good time.

#beer.py

import json

file = open('list.json',)
items = json.load(file)
for i in items['data']:
print(i['Type'])
file.close()
#list.json
{
"data": [
{
"ID": 1324,
"Type": "Beer"
},
{
"ID": 13213424,
"Type": "Wine"
},
{
"ID": 132324,
"Type": "Rum"
},
{
"ID": 1324,
"Type": "Whiskey"
}
]
}
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *