Question
Python You are so pleased with your employees, you have decided to promote one. There is a file available named employees.json, which contains a list
Python
You are so pleased with your employees, you have decided to promote one. There is a file available named "employees.json", which contains a list of dictionaries, each of which represents an employee. Use the load function of the json module and the open built-in function to access the data in this file to find the employee with the highest sales record. You should follow the Max pattern previously seen, but you will need to modify it in order to find the "Name" of the employee with the highest "New Sales".
Tip: Start by calculating the the maximum of the "New Sales" field. Now, what additional information do you need to store in order to print the final result?
json file is shown as following:
[ { "Name": "Victor Martinez", "New Sales": 320, "Salary": 26400, "ID": 1, "Dog Pictures Made": 200, "Position": "Armed forces logistics/support/administrative officer" }, { "Name": "David Kidd", "New Sales": 120, "Salary": 11600, "ID": 2, "Dog Pictures Made": 220, "Position": "Engineer, manufacturing systems" }, { "Name": "Andre Freeman", "New Sales": 115, "Salary": 54400, "ID": 3, "Dog Pictures Made": 197, "Position": "Newspaper journalist" }, { "Name": "Corey Rivas Jr.", "New Sales": 425, "Salary": 60100, "ID": 4, "Dog Pictures Made": 114, "Position": "Facilities manager" }, { "Name": "Meredith Meyer", "New Sales": 385, "Salary": 48400, "ID": 5, "Dog Pictures Made": 251, "Position": "Public relations account executive" }
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