Create a single list that contains the following collection of data in the order provided: [1121,
Fantastic news! We've Found the answer you've been seeking!
Question:
Create a single list that contains the following collection of data in the order provided:
[1121, "Jackie Grainger", 22.22,1122, "Jignesh Thrakkar", 25.25,1127, "Dion Green", 28.75, False,24.32, 1132, "Jacob Gerber", "Sarah Sanderson", 23.45, 1137, True,"Brandon Heck", 1138, 25.84, True,1152, "David Toma", 22.65,23.75, 1157, "Charles King", False, "Jackie Grainger", 1121, 22.22, False, 22.65, 1152, "David Toma"]
The data above represents employee information exported from an Excel spreadsheet. Whomever typed the data in originally didn't give much care to how the information was formatted, unfortunately. Each line of data has in it employee information (the whole number), the name of the employee (the string), and the employee's hourly wage (the decimal number). Some rows have extra information in them from a column in the spreadsheet that no one can remember what its purpose was.
Note that the presence of a couple of new data types in the above - "float" values (the numbers with the decimals in them) and "bool" [short for boolean] values (True and False).- Assume that the above information is a small sample of the company's data. Programmatically sort the information into three different lists: one for employee numbers, one for employee names, and one for employee salary information.
- No duplicate data should make its way into the new lists.
- For each value in the list containing hourly wage information, multiply the current value by 1.3 (since benefits are about 30% of a person's salary) and store each value in a list called total_hourly_rate. Programmatically determine the maximum value in the list and if it's over over 37.30, throw a warning message that someone's salary may be a budget concern.
- Determine if anyone's total hourly rate is between 28.15 and 30.65. If they are, add the hourly rate a new list called underpaid_salaries.
- For each value in the list that contains unmodified salary information, calculate a raise in dollars according to the following rules:
If the hourly rate is between 22 and 24 dollars per hour, apply a 5% raise to the current rate. If the hourly rate is between 24 and 26 dollars per hour, apply a 4% raise to the current rate. If the hourly rate is between 26 and 28 dollars per hour, apply a 3% raise to the current rate. All other salary ranges should get a standard 2% raise to the current rate.
Add each new value you calculate to a new list called company_raises.
- Design your own complex condition with no fewer than four different truth tests in it (all conditions must be on one line, in other words). Above your condition, write out in comments the exact behavior you are implementing with Python.
Related Book For
Financial Accounting For Management
ISBN: 9789385965661
4th Edition
Authors: Neelakantan Ramachandran, Ram Kumar Kakani
Posted Date: