import mysql.
connector as sql
conn=[Link](host='localhost',user='root',password='manager',database='
ATM_MACHINE')
c1=[Link]()
print("============================================================================
====")
print(" WELCOME TO OUR ATM ")
print("============================================================================
====")
print("[Link] create account")
print("[Link] login")
print("[Link]")
print("============================================================================
====")
op=int(input("Enter your choice :"))
print("============================================================================
====")
if op==1:
c="y"
while c=="y":
m=int(input("Enter a 4 digit number as accont number:"))
cb="select * from records where ACCONT_NO={}".format(m)
[Link](cb)
d=[Link]()
data=[Link]
if data==1:
print("============================================================================
====")
print("This account number already exists:")
c=input("Do you want to continue y/n -")
print("============================================================================
====")
if c=="y":
continue
else:
print(" Thank you.")
print(" PLEASE CLOSE THIS FILE BEFORE EXITING")
print("Visit again")
print("============================================================================
====")
else:
name=input("Enter your name:")
passw=int(input("Enter your pass word:"))
ab="insert into records(ACCONT_NO,PASSWORD,NAME) values({},
{},'{}')".format(m,passw,name)
print("============================================================================
====")
[Link](ab)
[Link]()
print("Account sucessfully created")
print("The minimum balance is 1000 ")
print("============================================================================
====")
s=int(input("Enter the money to be deposited :"))
print("============================================================================
====")
sr="update records set CR_AMT={} where ACCONT_NO={}".format(s,m)
[Link](sr)
[Link]()
ef="update records set balance=cr_amt-withdrawl where
ACCONT_NO={}".format(m)
[Link](ef)
[Link]()
print("sucessfully deposited")
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE EXITING")
print("Visit again")
break
if op==2:
y="y"
while y=="y":
acct=int(input("Enter your account number:"))
cb="select * from records where ACCONT_NO={}".format(acct)
[Link](cb)
[Link]()
data=[Link]
if data==1:
pas=int(input("Enter your password :"))
print("============================================================================
====")
e="select password from records where ACCONT_NO={}".format(acct)
[Link](e)
a=[Link]()
d=list(a)
if pas==d[0]:
print("correct")
print("[Link] money")
print("[Link] money")
print("[Link] money")
print("[Link] balance")
print("[Link] Account number ")
print("============================================================================
====")
r=int(input("Enter your choice:"))
print("============================================================================
====")
if r==1:
amt=int(input("Enter the money to be deposited:"))
print("============================================================================
====")
sr="update records set CR_AMT=CR_AMT + {} where
ACCONT_NO={}".format(amt,acct)
[Link](sr)
[Link]()
ef="update records set balance=cr_amt-withdrawl where
ACCONT_NO={}".format(acct)
[Link](ef)
[Link]()
print("sucessfully deposited")
t=input("Do you want to continue y/n -")
print("============================================================================
====")
if t=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE
EXITING")
if r==2:
amt=int(input("Enter the money to withdraw:"))
print("============================================================================
====")
ah="select BALANCE from records where
accont_no={}".format(acct)
[Link](ah)
m=[Link]()
if amt >m[0]:
print("Your are having less than",amt)
print("Please try again")
print("============================================================================
====")
else:
sr="update records set balance=balance - {}
where ACCONT_NO={}".format(amt,acct)
ed="update records set WITHDRAWL ={} where
ACCONT_NO={}".format(amt,acct)
[Link](ed)
[Link](sr)
[Link]()
print("Sucessfully updatad")
y=input("do you want to continue y/n -")
if y=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE
EXITING")
if r==3:
act=int(input("Enter the accont number to be
transferrsd :"))
print("============================================================================
====")
cb="select * from records where
ACCONT_NO={}".format(act)
[Link](cb)
[Link]()
data=[Link]
if data==1:
print(act ,"number exists")
m=int(input("Enter the money to be
transferred :"))
print("============================================================================
====")
ah="select BALANCE from records where
accont_no={}".format(acct)
[Link](ah)
c=[Link]()
if m > c[0]:
print("Your are having less than",m)
print("Please try again")
print("============================================================================
====")
else:
av="update records set balance=balance-{}
where ACCONT_NO={}".format(m,acct)
cv="update records set balance=balance+{}
where ACCONT_NO={}".format(m,act)
w="update records set
withdrawl=withdrawl+{} where accont_no={}".format(m,acct)
t="update records set CR_AMT=CR_AMT+{}
where accont_no={}".format(m,act)
[Link](av)
[Link](cv)
[Link](w)
[Link](t)
[Link]()
print("Sucessfully transfered")
y=input("do you want to continue y/n -")
if y=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE
BEFORE EXITING")
if r==4:
ma="select balance from records where
accont_no={}".format(acct)
[Link](ma)
k=[Link]()
print("Balance in your account=",k)
print("============================================================================
====")
y=input("do you want to continue y/n -")
if y=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE BEFORE
EXITING")
if r==5:
i=int(input("Enter your new account number:"))
cb="select * from records where
ACCONT_NO={}".format(i)
[Link](cb)
[Link]()
data=[Link]
if data==1:
print("This number already exists")
print("Try again")
y=input("do you want to continue y/n -")
if y=="y":
continue
else:
print(" Thank you")
print(" PLEASE CLOSE THIS FILE
BEFORE EXITING")
else:
name=input("Enter your name")
ar="Update records set accont_no={} where
name='{}' and password={}".format(i,name,pas)
[Link](ar)
[Link]()
print("Your new account number is ",i)
else:
print("Wrong password")
print("============================================================================
====")
y=input("do you want to continue y/n -")
else:
print("your Account does not exists")
if op==3:
print("Exiting")
print("Please close this file before exiting.")
[Link]()