Take a look at this loop:
while backPay >= 0:
balance2 -= standPay2
backPay += 1
Here, backPay
in increased in each iteration, so the condition backPay >= 0
will always be true.
Not sure what the code is intended to do, but probably you have to do backPay -= 1
instead. However, note that since the number of iterations of the loop is known beforehand, and you are just adding a fixed number in each iteration, you could just as well replace the loop with a simple multiplication.