ATM Karo…
We are done with turtle for now, but we will do some fascinating designs later using turtle. So I thought of doing something different in basics other than just learning new topics, so today we will make an ATM program which will resemble our actual ATM process. There are certain things which we have to understand before going into this program. (These constraints are for MY program not for any general ATM program)
→ NO real transaction is going to happen in our program.
→ We will create/show as if the actual process is happening.
→ If we connect the algorithm for this program with IOT and other modules then we can make an actual ATM.
→ It will not store any changes as for now, because in one case we will change the PIN value but when we will run the program again, it will use the older PIN value only.
→ Also this ATM will consist of a button, when you press that, the bank logo will appear and then only you can enter your card and proceed further.
So today we will just focus only on our first appearance. As described in the last point above that we can only insert our card after pressing the button. For now, let that button be START. So as the user is pressing the START, the logo/name of the bank should appear and also it should give the permission to enter the card and after successfully entering the card, the choices should appear. This is our today’s work.

We already have a lot of work to do in this program, so we will not do any fancy coding for our title. We will directly print whatever we want by using any special symbol ($,#,*). We will use 2 things for our heading, the tab spaces and the sleep function. As we want our title to be in center, we will use tab spaces using “\t” to make our title in the center. We have a function sleep which will cause the program to sleep for specified seconds, for this we have to first import time library.
import time
time.sleep(sec) #system will sleep for sec seconds
Similarly we can display everything using the sleep and tab spaces. But we know that choices should appear only if our PIN is correct. So after inserting our card, we will make our system to sleep for 4–5 seconds indicating that we are inserting a card. After this it should ask for PIN from the user.
Our program is only for one user with a fixed PIN of 1996.
So if the input is 1996, the choices should appear.
If we have any other PIN, it should give a message as wrong pin and should ask the user to enter again.
If this process is repeated for 3 times, a message should appear stating that your card has been blocked.
Following is the code for checking our PIN:
while True:
time.sleep(1);
pin=int(input(“\n PLEASE ENTER YOUR PIN TO CONTINUE: “));
if(pin==1996):
print(“\n CORRECT PIN”);
break;
else:
m=m+1
if(m==3):
print(“\n YOUR CARD IS BLOCKED!!!”);
break;
print(“\n YOUR PIN IS WRONG”);

So we have completed the first phase of our program, you can visit the link given below and check the output till now. We will discuss the choices given in the next blog. You can have your own choices and concept, but presentation should be in the same manner. That’s all for today, practice hard and keep coding…
