Advertisement
fevzi02

ПЗ - 2. Задание 11.

Oct 25th, 2021
1,060
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. class Bancomat:
  2.     def __init__(self):
  3.         self.balance = 0
  4.  
  5.     def replenishment(self,replenishment):      #ПОПОЛНЕНИЕ
  6.         self.balance += replenishment
  7.  
  8.     def withdrawing_funds(self, withdrawal):     #СНЯТИЕ
  9.         if self.balance > withdrawal:
  10.             self.balance -= withdrawal
  11.         else:
  12.             print("Balance Error")
  13.  
  14.     def balance_check(self):       #ПРОВЕРКА БАЛАНСА
  15.         print("Баланс = ",self.balance)
  16.  
  17. bancomat = Bancomat()
  18. bancomat.replenishment(int(input("Введите сколько вы хотите пополнить - ")))
  19. bancomat.withdrawing_funds(int(input("Введите сколько вы хотите снять - ")))
  20. bancomat.balance_check()
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement