ATM Transaction System in Python
PROGRAM:
balance = 1000
def check_balance():
print("The balance amount is ",balance)
def withdrawal():
global balance
amt = int(input("Enter your withdrawal amount: "))
if amt > balance:
print("Insufficient funds")
else:
balance -= amt
print("Amount withdrawn successfully!")
def deposit():
global balance
amount = int(input("Enter an amount to deposit: "))
if amount > 0:
balance += amount
print("Amount deposited successfully!")
else:
print("Enter a valid amount.")
def atm():
a=input("insert your card:")
pin_code = int(input("Enter your PIN code: "))
if pin_code == 1234:
b=input("current account or savings:")
print("\nATM Menu")
print("1. Check Balance")
print("2. Withdrawal")
print("3. Deposit")
print("4. Exit")
choice = input("Enter an option from 1-4: ")
if choice == '1':
check_balance()
elif choice == '2':
withdrawal()
elif choice == '3':
deposit()
elif choice == '4':
print("Thank you! Come again.")
else:
print("Please select a valid option between 1 and 4.")
else:
print("Incorrect PIN. Access Denied.")
print("Welcome to SBI!!!!!")
atm()
OUTPUT:
Comments
Post a Comment