Respuesta :
Answer:
A code was created to single list that contains the following collection of data in the order provided
Explanation:
Solution
#list that stores employee numbers
employeee_numbers=[1121,1122,1127,1132,1137,1138,1152,1157]
#list that stores employee names
employee_name=["Jackie Grainger","Jignesh Thrakkar","Dion Green","Jacob Gerber","Sarah Sanderson","Brandon Heck","David Toma","Charles King"]
#list that stores wages per hour employee
hourly_rate=[22.22,25.25,28.75,24.32,23.45,25.84,22.65,23.75]
#list that stores salary employee
company_raises=[]
max_value=0
#list used to store total_hourly_rate
total_hourly_rate=[]
underpaid_salaries=[]
#loop used to musltiply values in hourly_wages with 1.3
#and store in new list called total_hourly_rate
#len() is used to get length of list
for i in range(0,len(hourly_rate)):
#append value to the list total_hourly_rate
total_hourly_rate.append(hourly_rate[i]*1.3)
for i in range(0,len(total_hourly_rate)):
#finds the maximum value
if(total_hourly_rate[i]>max_value):
max_value=total_hourly_rate[i] #stores the maximum value
if(max_value>37.30):
print("\nSomeone's salary may be a budget concern.\n")
for i in range(0,len(total_hourly_rate)):
#check anyone's total_hourly_rate is between 28.15 and 30.65
if(total_hourly_rate[i]>=28.15 and total_hourly_rate[i]<=28.15):
underpaid_salaries.append(total_hourly_rate[i])
for i in range(0,len(hourly_rate)):
#check anyone's hourly_rate is between 22 and 24
if(hourly_rate[i]>22 and hourly_rate[i]<24):
#adding 5%
hourly_rate[i]+=((hourly_rate[i]/100)*5)
elif(hourly_rate[i]>24 and hourly_rate[i]<26):
#adding 4%
hourly_rate[i]+=((hourly_rate[i]/100)*4)
elif(hourly_rate[i]>26 and hourly_rate[i]<28):
#adding 3%
hourly_rate[i]+=((hourly_rate[i]/100)*3)
else:
#adding 2% for all other salaries
hourly_rate[i]+=((hourly_rate[i]/100)*2)
#adding all raised value to company_raises
company_raises.extend(hourly_rate)
#The comparison in single line
for i in range(0,len(hourly_rate)):
For this exercise i used ternary
operator hourly_rate[i]= (hourly_rate[i]+((hourly_rate[i]/100)*5)) if (hourly_rate[i]>22 and hourly_rate[i]<24) else (hourly_rate[i]+((hourly_rate[i]/100)*4)) if (hourly_rate[i]>24 and hourly_rate[i]<26) else hourly_rate[i]+((hourly_rate[i]/100)*2)