Program Console Vignaankosh.com
Execution Panel
Console is empty.
ATM PIN Verification System is an interactive PYTHON dry run visualizer from the While programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.
This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.
# ATM PIN verification with balance check
correct_pin = "1234"
balance = 5000
attempts = 0
max_attempts = 3
print("Welcome to Python Bank ATM")
while attempts < max_attempts:
pin = input("Enter your 4-digit PIN: ")
attempts += 1
if pin == correct_pin:
print(" PIN verified successfully!")
while True:
print("\n===== ATM MENU =====")
print("1. Check Balance")
print("2. Withdraw Money")
print("3. Deposit Money")
print("4. Exit")
choice = input("Enter your choice: ")
if choice == "1":
print(f"Your balance: ₹{balance:.2f}")
elif choice == "2":
amount = float(input("Enter amount to withdraw: "))
if amount <= balance:
balance -= amount
print(f" Withdrawn ₹{amount:.2f}")
print(f"Remaining balance: ₹{balance:.2f}")
else:
print(" Insufficient balance!")
elif choice == "3":
amount = float(input("Enter amount to deposit: "))
balance += amount
print(f" Deposited ₹{amount:.2f}")
print(f"New balance: ₹{balance:.2f}")
elif choice == "4":
print("Thank you for using Python Bank!")
break
else:
print("Invalid choice! Please try again.")
break
else:
remaining = max_attempts - attempts
if remaining > 0:
print(f" Invalid PIN! {remaining} attempts remaining")
else:
print(" Too many failed attempts! Card blocked.")
if attempts == max_attempts and pin != correct_pin:
print("Contact your branch to unblock your card.")