SHARE
TWEET

Untitled

a guest Jun 20th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [
  2.     {
  3.         "id": 1,
  4.         "name": "Bulbasaur",
  5.         "type": [
  6.             "grass",
  7.             "poison"
  8.         ]
  9.     },
  10.     {
  11.         "id": 2,
  12.         "name": "Ivysaur",
  13.         "type": [
  14.             "grass",
  15.             "poison"
  16.         ]
  17.     }
  18. ]
  19.      
  20. ["Bulbasaur","Ivysaur"]
  21.      
  22. import json
  23. try:
  24.     with open("./simple.json", 'r') as f:
  25.         contents = json.load(f)
  26. except Exception as e:
  27.     print(e)
  28.  
  29. print(contents[:]["name"])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top