This program simulates a simple ATM system using Python.
First, the user creates an ATM PIN. The account balance is initialized to ₹5000. After the PIN is created successfully, the program enters an infinite loop using while True, meaning it will keep running until the user chooses to exit.
Inside the loop, the user is asked to enter their PIN. If the entered PIN matches the created PIN, the ATM menu is displayed with four options:
Balance Enquiry
Deposit Money
Withdraw Money
Exit
The user selects an option by entering a number.
If the user chooses 1, the program displays the current balance.
If the user chooses 2, they are asked to enter a deposit amount. That amount is added to the existing balance, and a success message is shown.
If the user chooses 3, they are asked to enter the withdrawal amount. The program checks whether the withdrawal amount is less than or equal to the available balance. If sufficient funds are available, the amount is deducted and a success message is displayed. If not, it shows “Not enough balance.”
If the user chooses 4, the program prints a thank-you message and exits the loop using break, which stops the program.
If the user enters an invalid menu option, the program displays “Invalid option.”
If the entered PIN does not match the created PIN, the program displays “Wrong PIN. Try again.” and returns to the beginning of the loop.
Overall, this program demonstrates the use of variables, conditional statements (if-elif-else), loops, and basic input/output operations to create a simple ATM simulation.