Skip to content

Instantly share code, notes, and snippets.

@ofelix03
Last active May 2, 2021 20:22
Show Gist options
  • Select an option

  • Save ofelix03/4278913942f7b9e962fc549098d8d172 to your computer and use it in GitHub Desktop.

Select an option

Save ofelix03/4278913942f7b9e962fc549098d8d172 to your computer and use it in GitHub Desktop.
atm-class
class ATM(object):
@classmethod
def _authenticate(cls, pin):
# perform PIN verification and authentication
return True
@classmethod
def withdraw_money(cls, pin, amount):
if not cls._authenticate(pin):
raise InvalidPin('Wrong PIN')
cls.process_request(pin, amout)
@classmethod
def process_request(self, amount):
# perform proess to withdraw money
pass
# Method invocation to withdraw money
ATM.withdraw_money('1234', 20000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment