update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
25
.config/Code/User/History/5b464f92/84jY.py
Normal file
25
.config/Code/User/History/5b464f92/84jY.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
class BankAccount:
|
||||
def __init__(self, account_no: str, name: str, balance: float) -> None:
|
||||
self.account_no = account_no
|
||||
self.name = name
|
||||
self.balance = balance
|
||||
|
||||
def deposit(self, amount: float) -> None:
|
||||
self.balance += amount
|
||||
|
||||
def withdraw(self, amount: float) -> None:
|
||||
self.balance -= amount
|
||||
|
||||
def bank_fees(self) -> None:
|
||||
self.balance -= 0.05 * self.balance
|
||||
|
||||
def display(self) -> None:
|
||||
print('account no: ', self.account_no)
|
||||
print('name: ', self.name)
|
||||
print('balance: ', self.balance)
|
||||
|
||||
mahd_account = BankAccount('2587', 'Mahd', 0.0)
|
||||
mahd_account.deposit(500.0)
|
||||
mahd_account.withdraw(5.0)
|
||||
mahd_account.bank_fees()
|
||||
mahd_account.display()
|
Loading…
Add table
Add a link
Reference in a new issue