I need help with subtraction with variables in python.
The response to what happens is here:
Traceback (most recent call last):
File "/home/pi/Desktop/TheBacsShop.py", line 16, in <module>
balance_a -= 40
TypeError: unsupported operand type(s) for -=: 'str' and 'int'
>>>
And here is what I put:
balance_a -= 40
I really don't know whats wrong with my code. If you don't know what I am trying to do. I will explain:
So basically I want the 'player's balance' to start at any number ABOVE 40. But then subtract 40 from it. Without setting it to something. What would I do to achieve it?
(Whatever I am doing may be right just not available in THONNY PYTHON)
[EDIT]: OMG, the first of the awnser's u gave me are correct. But then (cue fail music) ANOTHER ERROR came up?!?!?!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…