Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Questions
3. Question 2

Instruction

Great job! Now let's help the customer service department send some emails.

The file named customers_data.json stores customer names and email addresses. But not everyone shared their email address – some are unknown.

Exercise

Read the customers_data.json file. Create a new dictionary that only contains information on people who provided their email. Save the results to a file named customers_with_emails.json.

Note: Each customer in customers_data.json has four fields: id, first_name, last_name, and email. The email field will sometimes have a null value.

Stuck? Here's a hint!

Remember, the variable will store information from the file:

emails = []
for customer in data:
  if customer["email"] is not None:
    emails.append(...)