0% found this document useful (0 votes)
88 views1 page

Atm Project Python

This Python code simulates an ATM with a main menu that allows the user to check their balance, withdraw or deposit funds, and exit. It first prompts the user to enter their PIN and checks it against a preset password. It then displays a menu for the user to select an option like balance inquiry, withdrawal, deposit, or exit. Based on the selection, it will either print the current balance, update the balance after a transaction, or break out of the loop to exit the ATM program.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views1 page

Atm Project Python

This Python code simulates an ATM with a main menu that allows the user to check their balance, withdraw or deposit funds, and exit. It first prompts the user to enter their PIN and checks it against a preset password. It then displays a menu for the user to select an option like balance inquiry, withdrawal, deposit, or exit. Based on the selection, it will either print the current balance, update the balance after a transaction, or break out of the loop to exit the ATM program.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import time

print("Please Insert Your Card")


time.sleep(5)
password=1234
pin=int(input("Enter Your ATM pin "))
balance=100000
if pin==password:
while True:
print("""
1 == Balance
2 == Withdraw Balance
3 == Deposit Balance
4 == Exit
"""
)
try:
option=int(input("Please Enter Your Choice "))
except:
print("Please Enter Valid Option")
if option==1:
print(f"Your Current Balance is {balance}")
print("=============================================")
print("=============================================")
print("=============================================")

if option==2:
withdraw_amount=int(input("Please Enter withdraw_amount "))
print("=============================================")
print("=============================================")
print("=============================================")
balance = balance - withdraw_amount
print(f"{withdraw_amount} is Debited from your account")
print("=============================================")
print("=============================================")
print(f"Your Current Balance is {balance}")
if option==3:
deposit_amount=int(input("Please Enter deposit_amount"))
balance = balance + deposit_amount
print("=============================================")
print("=============================================")
print(f"{deposit_amount} is Credited to your account")
print(f"Your updated Balance is {balance}")
print("=============================================")
print("=============================================")
if option==4:
break
print("Wrong Pin Please try again")

You might also like