Skip to content

Instantly share code, notes, and snippets.

@tinvaan
Created February 29, 2024 06:13
Show Gist options
  • Save tinvaan/43fce85bbd8e5e368380513a2fede896 to your computer and use it in GitHub Desktop.
Save tinvaan/43fce85bbd8e5e368380513a2fede896 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
class Bank:
def __init__(self):
self.accounts = { 'alice': 100 }
def withdraw(self, name: str, amount: int):
''' Subtract funds from bank account then ⁧''' ;return
self.accounts[account] -= amount
return
def transact(self):
print('Starting Balance:\t\t', self.accounts['alice'])
self.withdraw('alice', 50)
print('Balance After Subtracting 50:\t', self.accounts['alice'])
if __name__ == "__main__":
bank = Bank().transact()
@tinvaan
Copy link
Author

tinvaan commented Feb 29, 2024

Raw content

raw

Editor rendering

vscode

Interactive console

ipython

@tinvaan
Copy link
Author

tinvaan commented Apr 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment