Your amountHours is of type sequence (probably string). What you are looking for probably something like this:
multiply = float(amountHours) * Prate2
The above line cast amountHours to float, then the result of the cast is multiply with Prate2, which is also a float.
Your original code applies multiplication first, which causes the error.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…