File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,26 +43,26 @@ def atm_withdrawal(balance):
4343
4444 # 3. Successful transaction
4545 new_balance = balance - amount
46- print (f"Withdrawal successful. New balance: $ { new_balance :.2f} " )
46+ print (f"Withdrawal successful. New balance: KES { new_balance :.2f} " )
4747
48- # Log using the logging module instead of manual file writing
48+ # This logs using the logging module instead of manual file writing
4949 logging .info (f"Withdrawal of { amount } . New balance: { new_balance } " )
5050
5151 return new_balance
5252
5353 except ValueError :
54- # 4. Handle non-numeric input (e.g., if user types "abc")
54+ # 4. Handle non-numeric input (e.g., if user types "abc") just for better error handling
5555 print ("Error: Please enter a valid numerical amount." )
5656 return balance
5757
5858
59- # example usage / Perform the ATM Transaction
59+ # Example usage / Perform the ATM Transaction
6060def main ():
6161 current_balance = 5000.0
6262 print ("--- Welcome to my 2026 Python ATM ---" )
6363
6464 while True :
65- print (f"\n Current Balance: $ { current_balance :.2f} " )
65+ print (f"\n Current Balance: KES { current_balance :.2f} " )
6666 choice = input ("1. Withdraw\n 2. Exit\n Select option: " )
6767
6868 if choice == "1" :
You can’t perform that action at this time.
0 commit comments