Created
February 29, 2024 06:13
-
-
Save tinvaan/43fce85bbd8e5e368380513a2fede896 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Raw content
Editor rendering
Interactive console