import os
import platform
import [Link]
import pandas as pd
mydb=[Link](host="localhost",\
user="root",\
password="root",\
database="Bank")
mycursor=[Link]()
def Accinsert():
L=[]
Accno=int(input("Enter the Account number: "))
[Link](Accno)
name=input("Enter the Customer Name: ")
[Link](name)
age=int(input("Enter Age of Customer : "))
[Link](age)
occup=input("Enter the Customer Occupation:")
[Link](occup)
Address=input("Enter the Address of the Customer : ")
[Link](Address)
Mob=int(input("Enter the Mobile number: "))
[Link](Mob)
Aadharno=int(input("Enter the Aadhar number: "))
[Link](Aadharno)
Amt=float(input("Enter the Money Deposited: "))
[Link](Amt)
AccType=input("Enter the Account Type (Saving/RD/PPF/Current) :")
[Link](AccType)
cust=(L)
sql="Insert into ACCOUNT(Accno, Name,Age,occu,Address,Mob,Aadharno, amt, AccType)"
values("%s,%s %s,%s,%s,%s,%s,%s,%s")
[Link](sql,cust)
[Link]()
def AccView():
print("Select the search criteria: ")
print("1. Acc no")
print("[Link]")
print("3. Mobile")
print("4. Adhar")
print("5. View All")
ch=int(input("Enter the choice: "))
if(ch==1):
s=int(input("Enter ACC no: "))
rl=(s,)
sql="select * from account where Accno=%s"
[Link](sql,rl)
elif(ch==2):
s=int(input("Enter Name: "))
rl=(s,)
sql="select * from account where Name=%s"
[Link](sql,rl)
elif(ch==3):
s=int(input("Enter Mobile No: "))
rl=(s,)
sql="select * from account where Mob=%s"
[Link](sql,rl)
elif(ch==4):
s=int(input("Enter Adhar: "))
rl=(s,)
sql="select * from account where Aadhamo=%s"
[Link](sql,rl)
elif(ch==5):
sql="select * from account"
[Link](sql)
res=[Link]()
print("The Customer details are as follows:")
#print("(Accno ,Name, Age,occu,Address, Mob Aadharno,amt,AccType)")
#for x in res:
k=[Link](res,columns=["AcNo","Name","Age","Occn","Add", "Mob",
"Aadh","Amt","AccTy"])
print(k)
#print(x)
def AccDeposit():
L=0
Accno-int(input("Enter the Account number: "))
[Link](Accno)
Amtdeposit-eval(input("Enter the Amount to be deposited: "))
[Link](Amtdeposit)
month=input("Enter month of Salary: ")
[Link](month)
cust=(L)
sql="Insert into amt(Accno Amtdeposit, Month) values (%s %s,%s)"
[Link]([Link])
[Link]()
def accView():
print("Please enter the details to view the Money details:")
Accnoint(input("Enter the Account number of the Customer whose amount is to be
viewed :"))
sql="Select Account Accno, Account. Name,[Link] [Link] [Link],
Account. Mob, Account Aadharno, [Link],[Link], sum([Link]),
[Link] from Account INNER JOIN amt ONAccount Accno [Link] and [Link] = %s"
rl=(Accno,)
[Link]([Link])
[Link]()
for x in res:
print(x)
def closeAcc():
Accno-int(input("Enter the Account number of the Customer to be closed :"))
rl=(Accno,)
sql="Delete from amt where Accno=%s"
[Link]([Link])
sql="Delete from Account where Accno=%s"
[Link]()
def MenuSet(): #Function For The Student Management System
print("Enter 1: To Add Customer")
print("Enter 2: To View Customer")
print("Enter 3: To Deposit Money")
print("Enter 4: To Close Account")
print("Enter 5: To View All Customer Details")
try: #Using Exceptions For Validation
userinput = int(input("Please Select An Above Option: ")) #Will Take Input From
User
except ValueError:
exit("\nHy! That's Not A Number") #Error Message
else:
print("\n") #Print New Line
if(userInput == 1):
Accinsert()
elif (userinput==2):
AccView()
elif (userlinput==3):
AccDeposit()
elif (userInput==4):
closeAcc()
elif (userInput==5):
accView()
else:
print("Enter correct choice...")
MenuSet()
def runAgain():
runAgn=input("\nwant To Run Again Y/n:")
while([Link]() == 'y'):
if([Link]() == "Windows"):
print([Link]("cls"))
else:
print([Link]("clear"))
runAgn=input("\nwant To Run Again Y/n:")
MenuSet()
runAgain()