Digital

Making ATM’s with Python

How to make a python cash machine, coding with python atm construction

Rate this post

Hello friends, today let’s make the system used by banks in ATMs simple. We have all gone to withdraw money from ATMs. So, we wondered how these processes are done. We have made a project for you how to do this with Python and ATM construction. Let’s examine this now.

Atm Build Codes With Python

To begin with, let’s define the operations that I will write to the screen. We want these transactions to make balance inquiries, deposits, withdrawals and exits. We want him to perform the Balance Inquiry by pressing the 1 key, the Deposit by pressing the 2 key, the Withdrawal by pressing the 3 key, and the Exiting by pressing the q key.

print(“********************\nWelcome to ATM system\n********************” )

print(“””
Transactions:

1. Balance Inquiry
2. Deposit
3. Withdrawal

You can exit the program with the ‘q’ key.

“””)

Let’s first determine our balance. We set the balance as 1000 $.

balance = 1000 # Let our balance be 1000 $.

In the while loop, we assign values to the processes and write these values to the screen. We determine which key to press to perform which action. We add and subtract the values we have entered according to the operations.

while True:
action = input(“Enter action:”)

if (operation == “q”):
print(“Waiting again…”)
break
elif (operation == “1”):
print(“Your balance is {} TL”.format(balance))
elif (operation == “2”):
amount = int(input(“Amount you want to deposit:”))

balance += amount
elif (operation == “3”):
amount = int(input(“Amount you want to withdraw:”))
if (balance – amount < 0 ):
print(“You can’t withdraw that much…”)
print(“Your balance is {} TL”.format(balance))
continue
balance -= amount

Finally, with the else command, we want a valid transaction to be entered when a wrong key is pressed.

else: print(“Please enter a valid transaction.”)

Final Version of Atm Construction with Python:

print(“********************\nWelcome to ATM system\n********************” )

print(“””
Transactions:

1. Balance Inquiry
2. Deposit
3. Withdrawal

You can exit the program with the ‘q’ key.

“””)

balance = 1000 # Let our balance be 1000 $.

while True:
action = input(“Enter action:”)

if (operation == “q”):
print(“Waiting again…”)
break
elif (operation == “1”):
print(“Your balance is {} $”.format(balance))
elif (operation == “2”):
amount = int(input(“Amount you want to deposit:”))

balance += amount
elif (operation == “3”):
amount = int(input(“Amount you want to withdraw:”))
if (balance – amount < 0 ):
print(“You can’t withdraw that much…”)
print(“Your balance is {} $”.format(balance))
continue
balance -= amount

else:
print(“Please enter a valid transaction.”)

Today we have compiled for you how to make an ATM program with python. By developing these codes, you can turn the system into a real ATM. For this, you need to integrate the database.

We aim to offer you python projects with advanced projects starting from the simple, stay tuned…

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button