Project 23: Weather Widget
Python Challenge
Builds on these lessons
Step 1 of 3
Project
Reading a JSON Weather Response
Parse a saved API response with json.loads(raw_text) and read fields off the resulting dict. JSON is the most common format APIs return, and json.loads/json.dumps convert directly between that text and native Python dicts/lists — no manual parsing.
🎯 Your Task
Please add the exact code shown in the light gray box below to your editor.Do not delete your previous code, just insert these new lines in the correct place!
import json
raw_response = '{"city": "Denver", "tempF": 72, "condition": "Sunny"}'
weather = json.loads(raw_response)
print(f"{weather['city']}: {weather['tempF']}°F, {weather['condition']}")