UPDATE
By simply reading a json
file it is not in json form. You need to parse it with json
module.
import json
with open('data.json', 'r') as f:
data = json.loads(f.read())
for _ in data['name']:
print(_, data['name'][_])
More Related Contents:
- Test for answers in an IF block [duplicate]
- python – a collatz program automate the boring stuff [closed]
- Python3 how to define one length byte-string?(Solved)
- How can I specify the function type in my type hints?
- Pygame already installed; however, python terminal says “No module named ‘pygame’ ” (Ubuntu 20.04.1)
- Find column whose name contains a specific string
- Print new output on same line [duplicate]
- Image rotation while moving
- How do I detect if the mouse is hovering over a button? PyGame button class is not displaying the text or changing colour on hover
- pip or pip3 to install packages for Python 3?
- Get contents of a Tkinter Entry widget
- Why are str.count(”) and len(str) giving different output?
- What are good uses for Python3’s “Function Annotations”?
- PermissionError: [Errno 13] in Python
- How do you fix the “element not interactable” exception?
- What are the “parts” in a multipart email?
- ImportError: No module named ‘google’
- Python3 correct way to import relative or absolute?
- How to downgrade python from 3.7 to 3.6
- Updating OptionMenu from List
- Django values_list vs values
- Pip freeze vs. pip list
- Embed picture in email
- Beautifulsoup : Difference between .find() and .select()
- What is the Python 3 equivalent of “python -m SimpleHTTPServer”
- What’s the difference between ThreadPool vs Pool in the multiprocessing module?
- Python: Can a subclass of float take extra arguments in its constructor?
- Same name for classmethod and instancemethod
- How to calculate length of string in pixels for specific font and size?
- Why are str.count(”) and len(str) giving different outputs when used on an empty string?