Question: Given a dictionary d , that contains employee information in the format { employee _ id: { ' name ' : name, 'position': position, 'department':
Given a dictionary d that contains employee information in the format employeeid:
name: name, 'position': position, 'department': department returns a
new dictionary with the employee information by department using the format department:
empid: employeeid 'name': name, 'position': positionempid:
employeeid 'name': name, 'position': position Note that employee id
becomes the key and it disappears as a value in the inner dictionary. Do not mutate change the
original dictionary.
Preconditions and Postconditions
d: dict with format employeeid: name: name, 'position': position,
'department': department
Returns: dict with format department: empid: employeeid 'name': name,
'position': positionempid: employeeid 'name': name, 'position':
position
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
