Apr-27-2020, 06:57 PM
(This post was last modified: Apr-27-2020, 07:01 PM by deanhystad.)
You are paying 2.5 times for overtime.
You are not alone. I fall into the same trap at times and when I eventually step away from the computer and look at what I was doing I am appalled. The most important lesson I could teach you is that programming is a multi-part task. The first, and most important element is design, and that should occur away from the computer.
if hours > 40: pay = hours * rate # paid for overtime at regular rate overtime = (hours -40) * rate * 1.5 # and more pay for overtime at 1.5 * rateThis is not a programming error and has nothing to do with python. This is a logic error. I think you are too worried about how to solve your problem in python when you should instead be focusing on how to solve the problem and then implementing your solution in python.
You are not alone. I fall into the same trap at times and when I eventually step away from the computer and look at what I was doing I am appalled. The most important lesson I could teach you is that programming is a multi-part task. The first, and most important element is design, and that should occur away from the computer.