A console-based ATM simulator written in Python using core programming concepts: functions, loops, conditionals, input validation, and in-memory data handling.
This program simulates a realistic ATM system for registered bank account holders. Each user can securely log in using their account number and PIN, perform multiple banking operations, and receive a detailed receipt at the end of the session.
All account data is stored in Python lists and dictionaries during runtime. No files, databases, or external libraries are used.
- Python (functions, loops, conditionals)
- Lists and dictionaries for account storage
- Input validation using string methods
- No external libraries required
-
Main menu is displayed with options to:
- Perform an ATM operation
- Exit the program
- User enters an account number to log in.
- The system searches for the account in stored records.
- User enters PIN with a maximum of three attempts.
- On successful authentication, the ATM menu is displayed.
- All transactions are tracked during the session.
- A receipt is generated before exiting the session.
- Login requires a valid account number and PIN.
- PIN must contain only digits.
- Maximum of three incorrect attempts allowed.
- Account access is denied after exceeding attempts.
The system maintains predefined bank accounts in memory:
accounts = [
{
"name": "Ahmed",
"account_no": "49217385",
"pin": "1234",
"balance": 12000,
"initial_balance": 12000
},
...
]
- Accounts are searched by account number.
- PINs are stored as strings for validation consistency.
- Each account tracks its initial balance for receipt generation.
Once logged in, the account holder can:
- View Balance
- Deposit Money
- Withdraw Money
- Pay Utility Bills
- Change ATM PIN
- Exit Session
- Balance Inquiry: Displays current balance and logs the action.
- Deposit: Allows only positive numeric amounts.
- Withdrawal: Prevents overdrawing the account.
-
Utility Bill Payments:
- Electricity
- Gas
- Water
- Internet / WiFi
- Telephone / Mobile
- PIN Change: Requires old PIN verification and confirmation.
At the end of each session, a receipt is automatically generated showing:
- Account holder name
- Starting balance
- Closing balance
- Complete transaction history
If no actions were performed, the receipt clearly indicates this.
- Design menu-driven console applications.
- Implement secure authentication logic.
- Track and manage session-based state.
- Apply input validation and error handling.
- Simulate real-world ATM workflows using Python.
Feel free to explore, refactor, and extend this ATM simulator to enhance your Python programming skills.