From 13f68881dbc4355f53cb538f9a2725983f672663 Mon Sep 17 00:00:00 2001 From: hummusonrails Date: Thu, 14 May 2026 09:03:36 +0300 Subject: [PATCH] Implement update_contact_information --- __pycache__/bank.cpython-314.pyc | Bin 0 -> 6914 bytes bank.py | 373 ++++++++++++++++--------------- 2 files changed, 189 insertions(+), 184 deletions(-) create mode 100644 __pycache__/bank.cpython-314.pyc diff --git a/__pycache__/bank.cpython-314.pyc b/__pycache__/bank.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..77ba9174a6ffecbbdbf90d87ef3f9615ebb75cda GIT binary patch literal 6914 zcmb_g>u(%a6~D7D&%V4){NDJLSaq^VlqMyGv47pnPg%-+60@kbmGuP%?gH>m8`9l0mYcC}fx@(#e$9!aQCIc|6^+oDjMi{xS!%c^SHCR0^jMrDr$pD4^7 z2eL};4~(qkH%F>BGi&9|v5A|R4S95PaQJ5Cc3}%T5Is~3K5zkIfhcVij&_>REL7J? zElu%O@LpeAb;+^n2IUo$Z)%o0uUVR{8!k>aGc!YrqPI>BjTx#xi1!OE<4o+hg+f-z z-{lhRg<5RWyXi#xpyzt3LoK`2m^Y}uQJxaTMT3PJ^a%|j9Gry?A`z0qBLvRlB}+oG zi=F({mMzl_CAoaB5EbJIIc;I#4SA9(z8Z$j_@sZ--8wu6dPFv8*C$WMa21hrAJR2TZ&|1Xa~Rly=DG&h z^FHskCpI2=R>B9H)B&?|Rdg3>Q(M8cySyr7C$=4riH76G1EF~&X!cYFGFz*lb3q3M z&ZVHL4X56+uwGKtcUzj}w^USh!K5y;Oxv&>Ri!1Ip&!X867)fI3dszT8j_<(o(IAQ zRdHOVu4;@?bH2q47ewq)Ro#L;teZO14a-v1b%~cFOc;jSe@56hMUNv0^4zZg`Oo`s z!5(F@*^x(msciXCp@XD>S3(|=ZESr&fQZ{DX3}Ajumo1Rbpcp0w0Y4-n3V?fRzP@HZ+7H-yyWeP=r4h=MAl2oICIHR}tb69)>#&WR+}A z9Nm!j`E+<G-23lhx<1=T>=<$=n9{VN=@i68`ogh8(Q;0JA;lpwz0ihvuUls*T{m(DtS9R{W$rv;hDi4&xd0p7g6Qkmp*> zI_z|??R~a!RgKzt>~Eek%&9`Cf3Bcy@<6hBN46%H_=CtmywACySO;LK#_j~ip(UV z2m%OV$95r?9e6;1cmRTv=<{EaY~S%jDDzB9gIxVavKCuw+Mc*B=B?ku~$lsJaOqnlRy39}q~uD*Ye4ck8{6 z-n@1Fjy&;y>PqKfPFhFO2^a%cG|NOgkNR>x6;(8;M+@gd^V+Ey?x?s{iKy5qzn>c5 zOCcxex=#rmuA$&CAqoN$5t-v%@h%Zwo!MHUyWtzy)kK1hmv%Sux3C$>0{q0y3PZ(d zH1bI_=*iBA5C?mt(pZZN7@XqDf`-g|+7RqmVFkViJf z6T`sB?Ywt~LdODqLQ6ysy-Ma%fz^388BN50T4?)<_!~kAu%7}Div)*{##D+ny$@5l zo|OBQ!H=X{*Y3!po}y1_Kla{2z47D-*!KwkS|@BTq! zXNp^KTW-^^>wyw{EGE38^~1Q_s8dW>c}==jJ!jewFu)VelmdY>Wm9kXDRte8emm`a zG)%b{f{`i}Bl%2Bv#$Mq4m!G7An@W-IUwDHnIZPd{L3X=JP!B zEy&iBF&rb7-Pw9K42OgecUP3qAJlTZM?4Y4fV>=p+A7B4JjV>XMGd}(8VwCz_Uy$V z+Xzto2F%*FRQf~w{1K33R4?N)L&xzO>^BVr9EZpNy_8U(`S{@txwG+;*QgwAo(ehpCS1blJ0)@2iT0{ zWB9p;fcSnlmp$}oZ;&xXoo^a*Cm^2l#i6qh24V;yvM~{@2~RGj^-K_7>bi z`3n6t@bG51F9CUwmLzFAbwVmXBtW*8q+`;+Ljq)bUK&C!knI;nrK1lCknK|kq=790 HL}>9}!<~Mw literal 0 HcmV?d00001 diff --git a/bank.py b/bank.py index ab74f6f..59c55a9 100644 --- a/bank.py +++ b/bank.py @@ -1,184 +1,189 @@ -class Bank: - - def __init__(self, name): - # Manages accounts, transactions, and loans. Generates unique account numbers. - self.name = name - self.accounts = [] - self.transactions = [] - self.loans = [] - - - def create_account(self, account_holder, initial_balance): - # Creates a new account with a unique number and initial balance, add it to accounts array and return account number - pass - - - def get_account(self, account_number): - # Retrieves an account by its number, returns None if not found. - pass - - - def list_accounts(self): - # Lists all accounts with their details like account number, holder, balance - pass - - - def close_account(self, account_number): - # Closes an account by removing it from the list. - pass - - - def transfer_funds(self, from_account, to_account, amount): - # Transfers funds between accounts if sufficient balance is available, return boolean values depending on - # transfer success - pass - - - def generate_account_statement(self, account_number): - # Generates a transaction history for a given account number, return None if no account number found - pass - - - - def calculate_total_assets(self): - # Calculates the total assets by summing all account balances. - pass - - - def process_loan_payments(self): - # Processes loan payments by deducting the installment amount from the balance. - pass - - -class Account: - # Represents a bank account with balance and transactions. Default balance is 0. - def __init__(self, account_number, account_holder, balance=0.0): - self.account_number = account_number - self.account_holder = account_holder - self.balance = balance - self.transactions = [] - - - def deposit(self, amount): - # Deposits a positive amount to the account and records the transaction. When adding transaction to array specift "Deposit" and amount - pass - - - def withdraw(self, amount): - # Withdraws an amount if sufficient balance is available. When adding into transactions array, specify Withdraw and amount - pass - - - def get_balance(self): - # Returns the current balance of the account. - pass - - - def get_transaction_history(self): - # Retrieves the transaction history of the account. - pass - - - def apply_interest(self, rate): - # Applies interest based on a given rate. - pass - - - def overdraft_protection(self, amount): - # Checks if a withdrawal amount is within available balance. - pass - - - def update_contact_information(self, new_contact_info): - # Updates the contact information of the account holder. - pass - - -class Transaction: - # Represents a transaction with an ID, type, amount, and timestamp. - def __init__(self, transaction_id, account_number, amount, transaction_type, timestamp): - self.transaction_id = transaction_id - self.account_number = account_number - self.amount = amount - self.transaction_type = transaction_type - self.timestamp = timestamp - - - def process_transaction(self): - # Processes a transaction if the amount is positive. - return self.amount > 0 - - - def validate_transaction(self): - # Validates the transaction before processing. - return self.amount > 0 - - - def reverse_transaction(self): - # Reverses a transaction by negating the amount. - pass - - -class BankEmployee: - # Represents a bank employee with an ID, name, and role. - def __init__(self, employee_id, name, role): - self.employee_id = employee_id - self.name = name - self.role = role - - - def approve_loan(self, account_number, amount): - # Approves a loan request if the amount is positive. - return amount > 0 - - - def view_account_details(self, account_number): - # Views account details given an account number by returning account number - pass - - - def suspend_account(self, account_number): - # Return suspension message as string - pass - - - def generate_financial_report(self): - # Return string "Financial Report Generated" - return "Financial Report Generated" - - -class Loan: - # Represents a loan with an ID, amount, interest rate, and tenure. - def __init__(self, loan_id, account_number, amount, interest_rate, tenure): - self.loan_id = loan_id - self.account_number = account_number - self.amount = amount - self.interest_rate = interest_rate - self.tenure = tenure - self.remaining_balance = amount - - - def make_payment(self, amount): - # Makes a loan payment if the amount is within the remaining balance. - pass - - - def get_remaining_balance(self): - # Returns the remaining balance of the loan. - pass - - - def calculate_interest(self): - # Calculates interest on the remaining balance. - pass - - - def check_loan_eligibility(self, account_number, income, credit_score): - # Checks if an applicant is eligible for a loan based on income(>50k) and credit score(>650). Return boolean - pass - - # Allows restructuring of the loan with new terms. - def restructure_loan(self, new_terms): - self.tenure = new_terms.get("tenure", self.tenure) - self.interest_rate = new_terms.get("interest_rate", self.interest_rate) - return True +class Bank: + + def __init__(self, name): + # Manages accounts, transactions, and loans. Generates unique account numbers. + self.name = name + self.accounts = [] + self.transactions = [] + self.loans = [] + + + def create_account(self, account_holder, initial_balance): + # Creates a new account with a unique number and initial balance, add it to accounts array and return account number + pass + + + def get_account(self, account_number): + # Retrieves an account by its number, returns None if not found. + pass + + + def list_accounts(self): + # Lists all accounts with their details like account number, holder, balance + pass + + + def close_account(self, account_number): + # Closes an account by removing it from the list. + pass + + + def transfer_funds(self, from_account, to_account, amount): + # Transfers funds between accounts if sufficient balance is available, return boolean values depending on + # transfer success + pass + + + def generate_account_statement(self, account_number): + # Generates a transaction history for a given account number, return None if no account number found + pass + + + + def calculate_total_assets(self): + # Calculates the total assets by summing all account balances. + pass + + + def process_loan_payments(self): + # Processes loan payments by deducting the installment amount from the balance. + pass + + +class Account: + # Represents a bank account with balance and transactions. Default balance is 0. + def __init__(self, account_number, account_holder, balance=0.0): + self.account_number = account_number + self.account_holder = account_holder + self.balance = balance + self.transactions = [] + self.contact_information = {} + + + def deposit(self, amount): + # Deposits a positive amount to the account and records the transaction. When adding transaction to array specift "Deposit" and amount + pass + + + def withdraw(self, amount): + # Withdraws an amount if sufficient balance is available. When adding into transactions array, specify Withdraw and amount + pass + + + def get_balance(self): + # Returns the current balance of the account. + pass + + + def get_transaction_history(self): + # Retrieves the transaction history of the account. + pass + + + def apply_interest(self, rate): + # Applies interest based on a given rate. + pass + + + def overdraft_protection(self, amount): + # Checks if a withdrawal amount is within available balance. + pass + + + def update_contact_information(self, new_contact_info): + # Updates the contact information of the account holder. + if not isinstance(new_contact_info, dict): + return False + + self.contact_information.update(new_contact_info) + return True + + +class Transaction: + # Represents a transaction with an ID, type, amount, and timestamp. + def __init__(self, transaction_id, account_number, amount, transaction_type, timestamp): + self.transaction_id = transaction_id + self.account_number = account_number + self.amount = amount + self.transaction_type = transaction_type + self.timestamp = timestamp + + + def process_transaction(self): + # Processes a transaction if the amount is positive. + return self.amount > 0 + + + def validate_transaction(self): + # Validates the transaction before processing. + return self.amount > 0 + + + def reverse_transaction(self): + # Reverses a transaction by negating the amount. + pass + + +class BankEmployee: + # Represents a bank employee with an ID, name, and role. + def __init__(self, employee_id, name, role): + self.employee_id = employee_id + self.name = name + self.role = role + + + def approve_loan(self, account_number, amount): + # Approves a loan request if the amount is positive. + return amount > 0 + + + def view_account_details(self, account_number): + # Views account details given an account number by returning account number + pass + + + def suspend_account(self, account_number): + # Return suspension message as string + pass + + + def generate_financial_report(self): + # Return string "Financial Report Generated" + return "Financial Report Generated" + + +class Loan: + # Represents a loan with an ID, amount, interest rate, and tenure. + def __init__(self, loan_id, account_number, amount, interest_rate, tenure): + self.loan_id = loan_id + self.account_number = account_number + self.amount = amount + self.interest_rate = interest_rate + self.tenure = tenure + self.remaining_balance = amount + + + def make_payment(self, amount): + # Makes a loan payment if the amount is within the remaining balance. + pass + + + def get_remaining_balance(self): + # Returns the remaining balance of the loan. + pass + + + def calculate_interest(self): + # Calculates interest on the remaining balance. + pass + + + def check_loan_eligibility(self, account_number, income, credit_score): + # Checks if an applicant is eligible for a loan based on income(>50k) and credit score(>650). Return boolean + pass + + # Allows restructuring of the loan with new terms. + def restructure_loan(self, new_terms): + self.tenure = new_terms.get("tenure", self.tenure) + self.interest_rate = new_terms.get("interest_rate", self.interest_rate) + return True