Pro tip: Use try-except to catch errors when you python read json file into dict. Like this:
```python
try:
with open('data.json', 'r') as f:
data = json.load(f)
except json.JSONDecodeError as e:
print("JSON syntax error:", e)
except FileNotFoundError:
print("File not found, buddy.")
```
This’ll tell you exactly what’s breaking.
```python
try:
with open('data.json', 'r') as f:
data = json.load(f)
except json.JSONDecodeError as e:
print("JSON syntax error:", e)
except FileNotFoundError:
print("File not found, buddy.")
```
This’ll tell you exactly what’s breaking.
