Now 'data' is a Python dictionary (or list, depending on your JSON structure)
print(data) ```
How it works:
import json: Imports Python's built-in JSON library.with open(...): Opens the file."r"means open in read mode.encoding='utf-8'is highly recommended to prevent errors with special characters (like emojis or accented letters).json.load(file): Reads the file and converts the JSON data into a Python dictionary or list.
Other Common Scenarios
1. Reading a JSON String (not a file)
If you already have the JSON data as a string in your code, use json.loads() (the "s" stands for string):
```python import json
json_string = '{"name": "Alice", "age": 30}'
