Question: Write a code where you provide the names and working hours of 5 workers as TWO separate lists as Workers = [ Ahmad , Ali,

Write a code where you provide the names and working hours of 5 workers as TWO separate lists as Workers=[Ahmad, Ali, Muhammad, Salih, Waleed], Worker_hours =[20,45,32,38,50]. The hourly rate is fixed to $2.75. For these workers you have to write a report saying: For [worker], who worked for [hours], including [over time] Hours of overtime, for an hourly rate of: [hourly rate] and overtime rate: [overtime rate], his gross pay is: [gross pay].
Note that gross pay is calculated as: Hours Hourly Rate
An important point is that pay above 40 will get an hourly wage 1.5 time the regular wage
Hint: use len(list([list_name]) to find the number of elements in the list and then make use of while statement. Also note that, in order you refer a particular list element we use listname[index], e.g. in Workers list, Ahmad is at index 0, therefore to refer to Ahmad or the first element we use Workers[0].
 Write a code where you provide the names and working hours

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!