Introduction
Structured data formats help organize information clearly so computers and people can easily read, write, and share it.
Jump into concepts and practice - no test required
Structured data formats help organize information clearly so computers and people can easily read, write, and share it.
# Example: JSON format stores data as key-value pairs { "name": "Alice", "age": 30, "hobbies": ["reading", "cycling"] }
{
"city": "Paris",
"temperature": 20
}<person>
<name>Bob</name>
<age>25</age>
</person>name,age,city Alice,30,New York Bob,25,Paris
This program shows how to convert Python data into a structured JSON format. It makes the data easy to share or save.
import json # Create a Python dictionary with some data person = { "name": "Alice", "age": 30, "hobbies": ["reading", "cycling"] } # Convert the dictionary to a JSON string json_data = json.dumps(person, indent=2) # Print the JSON string print(json_data)
Structured data formats make it easier to work with data across different programs and languages.
They help avoid confusion by keeping data organized and consistent.
Structured data formats organize information clearly for easy use.
They help share data between different systems without errors.
Common formats include JSON, XML, and CSV.
import json
json_data = '{"city": "Paris", "population": 2148327}'
data = json.loads(json_data)
print(data["city"])import json
data = {"name": "Bob", "age": 25}
json_string = json.dumps(data)
print(json_string["name"])users = [
{"id": 1, "name": "Anna", "active": True},
{"id": 2, "name": "Ben", "active": False},
{"id": 3, "name": "Cara", "active": True}
]