Skip to content

Commit ebaba49

Browse files
committed
Added a security gate for regulating script behaviour when run and borrowed(imported) keeping it reusable and modular
1 parent bfc573d commit ebaba49

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

atm_project.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# 7. End
1616

1717
# 1. Set-up a professional logging
18+
1819
logging.basicConfig(
1920
filename="atm_transactions.log",
2021
level=logging.INFO,
@@ -58,7 +59,7 @@ def atm_withdrawal(balance):
5859
# example usage / Perform the ATM Transaction
5960
def main():
6061
current_balance = 5000.0
61-
print("--- Welcome to the 2026 Python ATM ---")
62+
print("--- Welcome to my 2026 Python ATM ---")
6263

6364
while True:
6465
print(f"\nCurrent Balance: ${current_balance:.2f}")
@@ -74,6 +75,5 @@ def main():
7475
print("Invalid selection.")
7576

7677

77-
# Perform the ATM Withdrawal
78-
atm_withdrawal(current_balance, 0)
79-
log_transaction("withdrawal", 0, current_balance)
78+
if __name__ == "__main__":
79+
main()

0 commit comments

Comments
 (0)