Advertisement
TShiva

Bankomat

May 30th, 2021
1,418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. import os
  2.  
  3. bank_account = 0  # счёт, на котором лежат деньги
  4.  
  5. while (True):
  6.     os.system('CLS')
  7.     print("Hello, Mr.Trixter")
  8.     print("Please select action")
  9.     print("1 - Show money")
  10.     print("2 - Put money")
  11.     print("3 - Get money")
  12.     print("4 - Exit")
  13.     button = int(input())
  14.     if (button == 1):
  15.         os.system('CLS')
  16.         print("Your money " + str(bank_account))
  17.     elif (button == 2):
  18.         os.system('CLS')
  19.         print("Enter the amount")
  20.         cash = int(input())
  21.         bank_account += cash
  22.     elif (button == 3):
  23.         os.system('CLS')
  24.         print("Enter the amount")
  25.         cash = int(input())
  26.         # TODO: Если на счёте нет денег, то мы сейчас всё равно можем их снять))
  27.         # TODO: if(???)
  28.         bank_account -= cash
  29.     elif (button == 4):
  30.         break
  31.     else:
  32.         continue
  33.     print("Please select action")
  34.     print("1 - Main menu")
  35.     print("2 - Exit")
  36.     button = int(input())
  37.     if (button == 1):
  38.         flag = True
  39.     elif (button == 2):
  40.         flag = False
  41.     # TODO: Обработка ошибки неправильного ввода
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement