Answer the question
In order to leave comments, you need to log in
ValueError: invalid literal for int() with base 10? I don’t understand what needs to be added so that when entering just a space or letters after put there is no error?
def put_money():
history = []
balance = 0
while True:
command = input("Enter command, please:")
command = command.lower()
if command.startswith("put"):
print("Thank you, money has arrived")
com, val, *_ = command.split()
balance = balance + int(val)
history.append(f"\t + {val}")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question