ATM Simulator in Python with Source Code

ATM Simulator in Python

Creating an ATM Simulator in Python offers an exciting opportunity to delve into the fundamentals of programming while crafting a practical application. This project is perfect for beginners aiming to grasp core programming concepts and for those who wish to understand how a simplified banking system operates. This blog post will guide you through the development of an ATM Simulator, including its key features and functionalities.

Download New Real Time Projects :-Click here

Library Management Systemhttps://updategadh.com/java-project/library-management-system-project-in-java/
E-commerce Applicationhttps://updategadh.com/jsp-javaj2ee/e-commerce-web-application/
Online Examination Systemhttps://updategadh.com/free-projects/online-examination-system-project/
Hospital Management Systemhttps://updategadh.com/jsp-javaj2ee/hospital-management-system-java/
Online Banking Systemhttps://updategadh.com/java-project/online-movie-ticket-booking-system/
Student Management Systemhttps://updategadh.com/java-project/student-management-system-project-in-java/
Car Rental Systemhttps://updategadh.com/free-projects/car-rental-management-system/
Top 10 Final Year Project Ideas in Python
https://updategadh.com/python-projects/top-10-final-year-project-ideas/
Top 10 Final Year Project Ideas

About the Project

The ATM Simulator project is a Python-based mini application designed to simulate basic banking operations. The project file consists of a single Python script (atm.py). This simple console-based system is designed with user-friendliness in mind, making it accessible even for beginners.

The system offers several essential features that mimic the core operations of a real ATM. These functionalities include viewing account statements, withdrawing and depositing funds, and changing the account’s PIN.

How the ATM Simulator Works

To begin, the user must enter an existing username. Once the username is verified, the system prompts the user to enter their PIN. If the credentials are correct, the user gains access to the ATM’s features:

  • Account Statement: Users can check their account statement, which provides a detailed summary of all their transactions, including deposits, withdrawals, and the current balance.
  • Withdraw Funds: The user can withdraw funds by simply entering the desired amount. The system automatically calculates the remaining balance after the transaction.
  • Deposit Funds: To deposit money, users can enter the deposit amount, and the system will update the balance accordingly.
  • Change PIN: For security, users can update their PIN. To do this, they must provide a new PIN and confirm it before it’s saved.
See also  Voting System Using Blockchain in Python Free Source Code

https://updategadh.com/category/php-project

This project does not rely on external databases or files; all the necessary data, including usernames, PINs, and account balances, are stored directly in the source code. This makes the project straightforward and ideal for educational purposes.

Project Features

  1. Sign In: Secure login with username and PIN.
  2. Account Statement: View transaction history and current balance.
  3. Withdraw Funds: Easily withdraw money from the account.
  4. Deposit Funds: Lodge or deposit money into the account.
  5. Change PIN: Update and secure the account PIN.

Project Demonstration

Below, I’ll provide a quick walkthrough of the project’s core code to illustrate how the ATM Simulator works.

Source Code

Here’s a simplified version of the Python code for the ATM Simulator. This code is kept concise for clarity, but feel free to expand and modify it according to your needs.

# atm.py - A simple ATM Simulator in Python

# Sample data stored within the code (no database required)
users = {
    "john_doe": {
        "pin": "1234",
        "balance": 5000,
        "transactions": []
    },
    "jane_smith": {
        "pin": "4321",
        "balance": 7500,
        "transactions": []
    }
}

# Function to display account statement
def account_statement(user_data):
    print("\n--- Account Statement ---")
    for transaction in user_data["transactions"]:
        print(transaction)
    print(f"Current Balance: ${user_data['balance']}")

# Function to withdraw amount
def withdraw_amount(user_data):
    amount = float(input("Enter amount to withdraw: $"))
    if amount <= user_data['balance']:
        user_data['balance'] -= amount
        user_data['transactions'].append(f"Withdrawn: ${amount}")
        print(f"${amount} withdrawn successfully!")
    else:
        print("Insufficient balance!")

# Function to deposit amount
def deposit_amount(user_data):
    amount = float(input("Enter amount to deposit: $"))
    user_data['balance'] += amount
    user_data['transactions'].append(f"Deposited: ${amount}")
    print(f"${amount} deposited successfully!")

# Function to change PIN
def change_pin(user_data):
    new_pin = input("Enter new PIN: ")
    confirm_pin = input("Confirm new PIN: ")
    if new_pin == confirm_pin:
        user_data['pin'] = new_pin
        print("PIN updated successfully!")
    else:
        print("PINs do not match!")

# Main ATM system function
def atm_system():
    username = input("Enter username: ")
    if username in users:
        user_data = users[username]
        attempts = 3
        while attempts > 0:
            pin = input("Enter PIN: ")
            if pin == user_data['pin']:
                print("\n--- Welcome to the ATM Simulator ---")
                while True:
                    print("\nOptions:")
                    print("1. Account Statement")
                    print("2. Withdraw Funds")
                    print("3. Deposit Funds")
                    print("4. Change PIN")
                    print("5. Exit")
                    choice = input("Choose an option (1-5): ")

                    if choice == '1':
                        account_statement(user_data)
                    elif choice == '2':
                        withdraw_amount(user_data)
                    elif choice == '3':
                        deposit_amount(user_data)
                    elif choice == '4':
                        change_pin(user_data)
                    elif choice == '5':
                        print("Thank you for using the ATM Simulator. Goodbye!")
                        break
                    else:
                        print("Invalid choice. Please try again.")
                break
            else:
                attempts -= 1
                print(f"Incorrect PIN. You have {attempts} attempts left.")
    else:
        print("Username not found!")

# Run the ATM system
if __name__ == "__main__":
    atm_system()

How to Run the Project

To run this project, ensure you have Python installed on your computer. Use a Python interpreter to run the aforementioned code after saving it as atm.py:

python atm.py
ATM Simulator in Python
  • atm program in python using if-else
  • atm project in python pdf
  • atm program in python with source code
  • atm program in python using for loop
  • atm program in python with source code
  • atm program in python using function
  • python atm actions hackerrank solution
  • atm program in python source code
  • atm simulator for students
  • atm program in python with source code
  • atm simulation system project
  • ATM Simulator in Python with Source Code
  • ATM Simulator in Python with Source Code
  • ATM Simulator in Python with Source Code
  • atm simulator project in python with source code

Post Comment