Question: Write a function make_dictionary(number) that takes input from the user such as name and major separated by a comma and creates a dictionary with keys

 Write a function make_dictionary(number) that takes input from the user such
as name and major separated by a comma and creates a dictionary

Write a function make_dictionary(number) that takes input from the user such as name and major separated by a comma and creates a dictionary with keys corresponding to names and values corresponding to majors. The parameter number is an integer that controls how many entries should be added to the dictionary. Your function should work with the following code: d= make dictionary (3) print(d) Save the main code and your function in a file named majors.py. You can test your code with input files such as ex1: python 3 dictionary.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!