Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a separate function (not part of the Employee class) named make_employee_dict that takes as parameters a list of names, a list of ID numbers,
Write a separate function (not part of the Employee class) namedmake_employee_dictthat takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object. It should do the same with the second value of each list, etc. to the end of the lists. As it creates these objects, it should add them to a dictionary, where the key is the ID number and the value for that key is the whole Employee object. The function should return the resulting dictionary.
For example, it could be used like this:
emp_names = ["Jean", "Kat", "Pomona"]emp_ids = ["100", "101", "102"]emp_sals = [30, 35, 28]emp_emails = ["Jean@aol.com", "Kat@aol.com", "Pomona@aol.com"]result = make_employee_dict(emp_names, emp_ids, emp_sals, emp_emails)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