Which of the following is the main reason we use structured data formats like JSON or XML?
Think about how computers and people both need to understand data clearly.
Structured data formats organize data in a clear way so both humans and computers can easily read and write it.
What will be the output of this Python code that reads a JSON string?
import json json_data = '{"name": "Alice", "age": 30}' result = json.loads(json_data) print(result['name'])
Look at what key is used to get the value from the dictionary.
The code converts the JSON string to a Python dictionary and prints the value for the key 'name', which is 'Alice'.
What is the output of this Python code that parses nested JSON data?
import json json_str = '{"person": {"name": "Bob", "contacts": {"email": "bob@example.com"}}}' data = json.loads(json_str) print(data['person']['contacts']['email'])
Follow the keys step by step to reach the email value.
The code accesses nested dictionaries inside the JSON data to get the email address.
Which of these is NOT a benefit of using structured data formats?
Think about what structured data formats do and what they do not do.
Structured data formats help organize and exchange data but do not automatically encrypt data.
What error will this Python code raise when trying to parse invalid JSON?
import json invalid_json = '{"name": "Eve", "age": 25,' json.loads(invalid_json)
Look at the JSON string carefully for syntax mistakes.
The JSON string is missing a closing brace and has a trailing comma, causing a JSONDecodeError.