Advertisement
simeonshopov

Account

May 27th, 2020
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. class Account:
  2.     def __init__(self, id: int, balance, pin: int):
  3.         self.__id = id
  4.         self.__pin = pin
  5.         self.balance = balance
  6.  
  7.     def get_id(self, pin):
  8.         if pin == self.__pin:
  9.             return self.__id
  10.         return 'Wrong pin'
  11.  
  12.     def change_pin(self, old_pin, new_pin):
  13.         if old_pin == self.__pin:
  14.             self.__pin = new_pin
  15.             return 'Pin changed'
  16.         return 'Wrong pin'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement