-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoops_practice.py
More file actions
35 lines (26 loc) 路 1.2 KB
/
Copy pathoops_practice.py
File metadata and controls
35 lines (26 loc) 路 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class BankAccountBlueprint:
def __init__(self, owner_name, initial_balance):
self.owner = owner_name
self.balance = initial_balance
# The magical money-depositing function
def deposit_money(self, amount):
self.balance += amount
print(f"馃挵 ${amount:,.2f} deposited successfully to {self.owner}'s safe.")
def display_balance(self):
print(f"馃懁 Account Holder: {self.owner}")
print(f"馃挸 Current Vault Balance: ${self.balance:,.2f}")
print("-" * 45)
def run_bank_simulation():
print("馃殌 Starting Sudhir's Advanced OOPs Practice Session...\n")
# 1. OBJECT CREATION: Creating a live account for Sudhir-ji
sudhir_account = BankAccountBlueprint("Sudhir Kumar Mishra", 1500)
# 2. DISPLAY INITIAL STATE
sudhir_account.display_balance()
# 3. TRANSACTION EXECUTION: Crediting a $695 live bonus to the account.
sudhir_account.deposit_money(695)
# 4. FINAL VALIDATION
print("\n馃搳 Updated Financial Status:")
sudhir_account.display_balance()
print("馃帀 OOPs practice variation executed successfully with 100% computational integrity!")
if __name__ == "__main__":
run_bank_simulation()