About Python
About Python
MySQL Database
SOURCE CODE
import random
import mysql.connector
import pandas as pd
db=mysql.connector.connect(host='localhost',username='root',passwo
rd='sawan',database='datacamp')
cursor=db.cursor()
ctr=0
bank=1
while bank==1:
print('+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--')
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
choice=str(input("Option :- "))
print('*******************************************')
if choice==1:
def welcome_message():
print('\t\t\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
print('\t\t\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
def login():
while True:
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
value=(us,p)
cursor.execute(query,value)
data_login=cursor.fetchall()
if len(data_login)!=0:
globals()['ctr']=1
break
else:
print('LOGIN UNSUCCSESSFUL')
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
return data_login
def interface():
welcome_message()
b=login()
if globals()['ctr']==1:
i=b[0][0]
name=b[0][2]
print("LOGIN SUCCESSFUL")
print('+++++++++++++++++++++++++++++++++++++
+++++++\n')
c=1
while c==1:
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
if ch==1:
money_deposit=int(input('Amount to be
deposited :- '))
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
db.commit()
q='select balance from customers where id=
%s and username=%s'
cursor.execute(q,(i,name))
a=cursor.fetchall()
a=a[0]
for x in a:
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
elif ch==2:
money_withdrawn=int(input('Amount to be
withdrawn :- '))
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
db.commit()
%s and username=%s'
cursor.execute(q,(i,name))
a=cursor.fetchall()
a=a[0]
for x in a:
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
elif ch==3:
and username=%s'
cursor.execute(q,(i,name))
a=cursor.fetchall()
a=a[0]
for x in a:
condition=x
if condition=='false':
print('-----------------------------------------')
print('For KYC you need to provide
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
if cho==1:
ad=int(input("Aadhar Number :-
"))
cursor.execute('update customers
db.commit()
print("\nKYC Done")
elif cho==2:
vi=int(input("Voter Id Number :-
"))
cursor.execute('update customers
db.commit()
print("\nKYC Done")
elif cho==3:
"))
cursor.execute('update customers
db.commit()
print("\nKYC Done")
elif ch==4:
dl=str(input("Driving License
Number :- "))
cursor.execute('update customers
db.commit()
print("\nKYC Done")
else:
print('\nWrong Choice')
else:
print('____________________________________________')
elif ch==4:
%s and username=%s'
cursor.execute(q,(i,name))
a=cursor.fetchall()
a=a[0]
for x in a:
print("\nBalance :- ",x)
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n')
elif ch==5:
c=0
else:
print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n')
interface()
elif choice==2:
idea=random.randint(1,100)
acno=random.randint(500000000000,1000000000000)
print('---------------------------------------\n')
kyc='false'
query='insert into customers values(%s,%s,%s,%s,%s,%s,%s,%s,
%s)'
value=(idea,name,username,pas,balance,age,gender,kyc,acno)
cursor.execute(query,value)
db.commit()
elif choice==3:
print('------------------------------------\n')
value=(us,p)
password=%s "
cursor.execute(query,value)
data_login=cursor.fetchall()
username=%s',(data_login[0][0],data_login[0][2]))
db.commit()
elif choice==4:
def welcome_message():
print('\t\t\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
print('\t\t\t\tBANK OF INDIA\b')
print('\t\t\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')
welcome_message()
cursor.execute(i)
i=cursor.fetchall()
df = pd.DataFrame(i)
print(df)
elif choice==5:
print('==================================================\n\
n')
elif choice==6:
bank=0
print('\nThankyou for using Us')
else:
print('Wrong Option')
print('==========================================')
•