Python Is
Python Is
def withamt():
am = int(input("Enter Amount: "))
ac = int(input("Enter Account No: "))
a = "select balance from amt where accno = %s"
data = (ac,)
c = con.cursor()
c.execute(a,data)
myresult = c.fetchone()
tam = myresult[0] - am
sql = " update amt set balance = %s where accno = %s"
d = (tam,ac)
c.execute(sql,d)
myresult = c.fetchone()
tam = myresult[0] - am
sql = " update amount set balance = %s where accno
="%s"
d = (tam,ac)
c.execute(sql,d)
con.commit()
main()
def balance():
ac =int(input("Enter Account No: "))
a = "select balance from amount where accno = %s"
data = (ac,)
c = con.cursor()
c.execute(a,data)
myresult = c.fetchone()
print("Balance for Account: "‚ac," is ",myresult[0])
main()
def dispacc():
ac =int( input("Enter Account No: "))
a = "select * from account where accno = %s"
data = (ac,)
c = con.cursor()
c.execute(a,data)
myresult = c.fetchone()
for i in myresult:
print(i, end =" ")
main()
def closeacc():
ac = int(input("Enter Account No: "))
sql1 = "delete from account where accno = %s"
sql2 = "delete from amount where accno = %s"
data = (ac,)
c = con.cursor()
c.execute(sq|1,data)
c.execute(sql2,data)
con.commit()
main()
def main():
print(''
1. OPEN NEW ACCOUNT
2. DEPOSIT AMOUNT
3. WITHDRAW AMOUNT
4. BALANCE ENQUIRY
5. DISPLAY CUSTOMER DETAILS
6. CLOSE AN ACCOUNT
‘’)
choice = int(input("Enter Task No : "))
if (choice == '1'):
openAcc()
elif (choice=='2'):
depoAmo()
elif (choice== ‘3'):
witham()
elif (choice=='4'):
balance()
elif (choice=='5'):
disacc()
elif (choice == '6'):
closeacc()
else:
print(" Wrong choice....")
OUTPUT
I