Skip to content

Instantly share code, notes, and snippets.

@amalgjose
Created May 9, 2021 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save amalgjose/9cc1c9dee7884a76064e6703791914a7 to your computer and use it in GitHub Desktop.
Save amalgjose/9cc1c9dee7884a76064e6703791914a7 to your computer and use it in GitHub Desktop.
from pprint import pprint
sample_json = {
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters":
{
"batter":
[
{ "id": "1001", "type": "Regular" },
{ "id": "1002", "type": "Chocolate" },
{ "id": "1003", "type": "Blueberry" },
{ "id": "1004", "type": "Devil's Food" }
]
},
"topping":
[
{ "id": "5001", "type": "None" },
{ "id": "5002", "type": "Glazed" },
{ "id": "5005", "type": "Sugar" },
{ "id": "5007", "type": "Powdered Sugar" },
{ "id": "5006", "type": "Chocolate with Sprinkles" },
{ "id": "5003", "type": "Chocolate" },
{ "id": "5004", "type": "Maple" }
]
}
print(sample_json)
pprint(sample_json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment