Objective
Create a Python program that reads a JSON object and shows some of its data with the json module.
Instructions
- Read a line with a JSON object with the keys
name(text),age(number) andhobbies(list of texts). - Convert it into a Python dictionary with
json.loads. - Show three lines:
Name: N,Age: AandHobbies: K, whereKis the number of hobbies.
{"name": "Ana", "age": 30, "hobbies": ["leer", "correr"]}
Name: Ana
Age: 30
Hobbies: 2
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise