Reall
Reall
connector as ms
mydb=ms.connect(host="localhost",user="root",passwd="12345",data
base="bank")
mc=mydb.cursor()
mc.fetchall()
count=mc.rowcount
#Functions
def display():
mc.fetchall()
count=mc.rowcount
rec=mc.fetchall()
for i in range(0,count):
print(rec[i])
def insert():
a='y'
while a in 'yY':
if d>=5000:
mc.execute("commit;")
else:
print(" ")
rec2=mc.fetchall()
print(" ")
mc.fetchall()
count=mc.rowcount
for i in range(0,count):
print(rec2[i])
def modify():
check="NO"
recc=mc.fetchall()
mc.fetchall()
count=mc.rowcount
for i in range(0, count):
if m==recc[i][0]:
check="YES"
if check=="YES":
print("1. Name")
print("3. Address")
if n==1:
mc.execute("commit;")
elif n==2:
mc.execute("commit;")
elif n==3:
mc.execute("commit;")
elif n==4:
mc.execute("commit;")
else:
rec2=mc.fetchall()
mc.fetchall()
count=mc.rowcount
print(" ")
for i in range(0,count):
print(rec2[i])
else:
def delete():
check="NO"
recc=mc.fetchall()
mc.fetchall()
count=mc.rowcount
if j==recc[i][0]:
check="YES"
if check=="YES":
mc.execute("commit;")
mc.fetchall()
count=mc.rowcount
print(" ")
for i in range(0,count):
print(rec2[i])
else:
def search():
check="NO"
recc=mc.fetchall()
if p==recc[i][0]:
check="YES"
if check=="YES":
rec=mc.fetchall()
print(rec)
else:
def transaction():
check="NO"
recc=mc.fetchall()
if d==recc[i][0]:
check="YES"
if check=="YES":
print("1- Withdraw")
print("2- Deposit")
e=int(input("Enter your choice-"))
rec3=mc.fetchall()
if e==1:
if (rec3[0][0]-a)>=5000:
mc.execute("commit;")
mc.execute("commit;")
rec2=mc.fetchall()
else:
rec5=mc.fetchall()
print("Insufficient balance. The maximum you can withdraw is:
",rec5[0][0])
elif e==2:
mc.execute("commit;")
mc.execute("commit;")
rec2=mc.fetchall()
else:
else:
def history():
a=int(input("Enter your account no.-"))
rec=mc.fetchall()
rec=mc.fetchall()
rec=mc.fetchall()
print("Address - ",rec[0][0])
rec=mc.fetchall()
rec=mc.fetchall()
print("1-Admin")
print("2-Client")
if a==1:
b=input("Enter passkey:-")
if b=="admin@123":
print(" 6. Exit")
res='y'
if x==1:
display()
elif x==2:
insert()
elif x==3:
search()
elif x==4:
modify()
elif x==5:
delete()
elif x==6:
break
else:
print(" ")
print(" ")
else:
print("Invalid Passkey!!")
elif a==2:
print(" 1. Do a Transaction")
print(" 3. Exit")
res='y'
if x==1:
transaction()
elif x==2:
history()
elif x==3:
break
else:
print(" ")
res=input("DO YOU WANT TO CONTINUE(y/n):-")
print(" ")