Exporting to JSON
📖 Scenario: You work in a small store that keeps track of product sales. You want to save the sales data in a file so it can be shared with your team easily.
🎯 Goal: Create a Python program that stores sales data in a dictionary, then exports this data to a JSON file.
📋 What You'll Learn
Create a dictionary with product names and their sales numbers
Create a filename variable for the JSON file
Use the json module to export the dictionary to a JSON file
Print a confirmation message after exporting
💡 Why This Matters
🌍 Real World
Exporting data to JSON is common when sharing data between programs or saving data for later use.
💼 Career
Data analysts and scientists often export processed data to JSON files to share with teams or use in web applications.
Progress0 / 4 steps