A
A
Artemii142021-04-11 21:07:20
A/b testing
Artemii14, 2021-04-11 21:07:20

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

1 answer(s)
A
Artemii14, 2021-04-11
@Artemii14

I'm just starting to figure this out, and I can't think of anything. It's very hard given.

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question