Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  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"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement