Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Chapter 9 Part 1 - Create a Dictionary Write a program that creates a dictionary called emails that will contain names and email addresses, where
Chapter Part Create a Dictionary
Write a program that creates a dictionary called emails that will contain
names and email addresses, where name is the key and email address is
the value.
In main, call a function called create dictionary to create and add
entries to the dictionary. This function should return the dictionary to
main where it should be stored in the emails variable.
In the create dictionary function, create a new dictionary called
emails and in a while loop, ask the user to enter names and email
addresses until they choose to stop. Return the emails dictionary to
main.
In main, upon receiving the emails dictionary, print how many entries are
in the dictionary, using the len function.
In main, print the keys and values in the dictionary using a for loop.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started