I have a list (with decimals) and a variable (with decimals). I want that variable to decrease by every number in that list combined.
EXAMPLE:
list = [0.9, 1.1, 1.2, 0.8]a = 5a -= list[0:len(list]a SHOULD equal 1 but I keep getting an errorEXAMPLE2:
Four people work at a job and they each have different paychecks (list), the boss wants to know how much money he gets so we wants to deduct the profit (a) by each of the workers paychecks combined.
So how could that be translated into code?
The error:TypeError: unsupported operand type(s) for -=: 'int' and 'list'