Код: Выделить всё
def check_balance():
pass
def deposit():
pass
def withdraw():
pass
balance = 0
is_running = True
while is_running:
print("1.Check Balance")
print("2.Deposit")
print("3.Withdraw")
print("4.Exit")
choice = str(input("Enter your choice (1-4): "))
print("User chose", choice)
if choice == '1':
check_balance()
print("checked")
elif choice == '2':
deposit()
print("depod")
elif choice == '3':
withdraw()
print("withdrawed")
elif choice == '4':
is_running = False
print("set isrunning to false")
else:
print("That is not a valid choice.")
print("Thank you! Have a nice day!")
Как видите, я попробовал добавить в код больше операторов печати. чтобы увидеть, где ошибка, но когда я запускаю программу и ввожу число от 1 до 4, она вообще не возвращает ни одного оператора печати. Если я введу 4, он просто вернется к началу цикла while.
Подробнее здесь: https://stackoverflow.com/questions/792 ... cted-to-it
Мобильная версия