So im trying to learn by doing and now this error occured:
Traceback (most recent call last):
File "C:/Users/Marcel/PycharmProjects/untitled/bank.py", line 14, in <module>
newbal = bal - howmuch
TypeError: unsupported operand type(s) for -: 'int' and 'str'
For this Block of code:
id = input("Enter Bank ID: ")
bal = 1500
if id == "12345":
print ("Correct!")
print("You have a total Balance of",bal,"$")
choi = input("What do you want to do? (Q)uit or (T)ake Money: ")
if choi == "Q":
quit()
if choi == "T":
howmuch = input("How much?: ")
newbal = bal - howmuch
print ("You took",howmuch,"$ from your Bank Account!")
print ("Total Balance:",newbal)
How am i supposed to substract the input from the variable?
Please help! :D