Skip to content

Commit c2cfdf4

Browse files
committed
Final Well Documented Code
1 parent ebaba49 commit c2cfdf4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

atm_project.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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
6060
def main():
6161
current_balance = 5000.0
6262
print("--- Welcome to my 2026 Python ATM ---")
6363

6464
while True:
65-
print(f"\nCurrent Balance: ${current_balance:.2f}")
65+
print(f"\nCurrent Balance: KES{current_balance:.2f}")
6666
choice = input("1. Withdraw\n2. Exit\nSelect option: ")
6767

6868
if choice == "1":

0 commit comments

Comments
 (0)