You are on page 1of 21

ACKNOWLEDGEMENT

It is with great pleasure that I find myself penning

Down these lines to express my sincere thanks to all

Those people who helped me a long way in Complete


this project.

The harmonious climate in our school provided Proper


atmosphere for creating this project. It was a Privilege to
have been guided by Ms. Darshana Soni.

I am so grateful to my parents and classmates who


helped me during the finalization of my project with
their constructive criticism and advice.

PAGE- 1
INDEX

SR NO. CONTENTS PAGE NO.

1. INTRODUCTION 5-8 5-6

i. ABOUT PYTHON ii. 7-8


ABOUT MYSQL iii.
9
ABOUT BANK
MANAGEMENT
SYSTEM

2. SOURCE CODE 10-22

3. OUTPUT 23-26

4. BIBLIOGRAPHY 27

PAGE- 2
INTRODUCTION

ABOUT PYTHON:
Python is an interpreted, object-oriented, high-level
programming language with dynamic semantics. Its
high-level built in data structures, combined with
dynamic typing and dynamic binding, make it very
attractive for Rapid Application Development, as well
as for use as a scripting or glue language to connect
existing components together. Python's simple, easy
to learn syntax emphasizes readability and therefore
reduces the cost of program maintenance. Python
supports modules and packages, which encourages
program modularity and code reuse. The Python
interpreter and the extensive standard library are
available in source or binary form without charge for
all major platforms, and can be freely distributed.

Often, programmers fall in love with Python because


of the increased productivity it provides. Since there
is no compilation step, the edit-test-debug cycle is

PAGE- 3
incredibly fast. Debugging Python programs is easy: a
bug or bad input will never cause a segmentation
fault. Instead, when the interpreter discovers an
error, it raises an exception. When the program
doesn't catch the exception, the interpreter prints a
stack trace. A source level debugger allows inspection
of local and global variables, evaluation of arbitrary
expressions, setting breakpoints, stepping through
the code a line at a time, and so on. The debugger is
written in Python itself, testifying to Python's
introspective power. On the other hand, often the
quickest way to debug a program is to add a few print
statements to the source: the fast edit-test-debug
cycle makes this simple approach very effective.

PAGE- 4
ABOUT MYSQL:
MySQL is a fast, easy-to-use RDBMS being used for many small and big
businesses. MySQL is developed, marketed and supported by MySQL
AB, which is a Swedish company. MySQL is becoming so popular
because of many good reasons −

• MySQL is released under an open-source license. So you have


nothing to pay to use it.

• MySQL is a very powerful program in its own right. It handles a


large subset of the functionality of the most expensive and
powerful database packages.

• MySQL uses a standard form of the well-known SQL data


language.

• MySQL works on many operating systems and with many


languages including PHP, PERL, C, C++, JAVA, etc.

• MySQL works very quickly and works well even with large data
sets.

• MySQL is very friendly to PHP, the most appreciated language for


web development.

• MySQL supports large databases, up to 50 million rows or more


in a table. The default file size limit for a table is 4GB, but you can

PAGE- 5
increase this (if your operating system can handle it) to a
theoretical limit of 8 million terabytes (TB).

• MySQL is customizable. The open-source GPL license allows


programmers to modify the MySQL software to fit their own
specific environments.

ABOUT BANK MANAGEMENT SYSTEM:


Bank Management System is based on dot NET and is a major
project fro students.It is used to Keep the records of
clients,employee etc in Bank.The bank management system is an
application for maintaining a person „C/S account in a bank. The
system provides the access to the customer to create an account,
deposit/withdraw the cash from his account, also to view reports
of all accounts present. The following presentation provides the
specification for the system.

PAGE- 6
SOURCE CODE
import random

import mysql.connector

import pandas as pd

db=mysql.connector.connect(host='localhost',username='root',password='sawan',database=

'datacamp')

cursor=db.cursor()

ctr=0

bank=1

while bank==1:

print('+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--')

print('Press 1 for Online Banking')

print('Press 2 for Registering a new bank account')

print('Press 3 for Deleting your account')

print('Press 4 for checking All Account')

print('Press 5 for Customer Help Services')

print('Press 6 for exit')

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

choice=int(input("Option :- "))

print('*******************************************')

PAGE- 7
if choice==1:

def welcome_message():

print('\t\t\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

print('\t\t\tWELCOME TO BANK OF INDIA\b')

print('\t\t\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

def login():

while True:

us=input("Enter your username :- ")

p=int(input("Enter your password :-"))

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

value=(us,p)

query="""select * from customers where username=%s and

password=%s """

cursor.execute(query,value)

data_login=cursor.fetchall()

if len(data_login)!=0:

globals()['ctr']=1

break

else:

print('LOGIN UNSUCCSESSFUL')

PAGE- 8
print("USERNAME OR PASSWORD IS WRONG")

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('Press 1 for depositing money')

print('Press 2 for withdrawing money')

print('Press 3 for doing kyc')

print('Press 4 for checking balance')

print('Press 5 for logging out')

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

PAGE- 9
ch=int(input("Enter your option :- "))

if ch==1:

money_deposit=int(input('Amount to be deposited :- '))

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

cursor.execute('update customers set

balance=balance+%s where id=%s',(money_deposit,i))

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("Updated Balance :- ",x)

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

elif ch==2:

money_withdrawn=int(input('Amount to be withdrawn

:- '))

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

cursor.execute('update customers set balance=balance-

%s where id=%s',(money_withdrawn,i))

PAGE- 10
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("Updated Balance :- ",x)

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

elif ch==3:

q='select kyc from customers where id=%s and

username=%s'

cursor.execute(q,(i,name))

a=cursor.fetchall()

a=a[0]

for x in a:

condition=x

if condition=='false':

print('For KYC you need to provide details from

one of these government id')

print('Press 1 for Aadhar Card')

PAGE- 11
print('Press 2 for Voter Id Card')

print('Press 3 for Pan Card')

print('Press 4 for Driving License')

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

cho=int(input("Enter your choice :- "))

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')

if cho==1:

ad=int(input("Aadhar Number :- "))

cursor.execute('update customers set

kyc="true" where id=%s and username=%s',(i,name))

db.commit()

print("KYC Done")

elif cho==2:

vi=int(input("Voter Id Number :- "))

cursor.execute('update customers set

kyc="true" where id=%s and username=%s',(i,name))

db.commit()

print("KYC Done")

elif cho==3:

pc=int(input("Pan Card Number :- "))

PAGE- 12
cursor.execute('update customers set

kyc="true" where id=%s and username=%s',(i,name))

db.commit()

print("KYC Done")

elif ch==4:

dl=int(input("Driving License Number :- "))

cursor.execute('update customers set

kyc="true" where id=%s and username=%s',(i,name))

db.commit()

print("KYC Done")

else:

print('Wrong Choice')

else:

print('KYC Already Done')

print('____________________________________________')

elif ch==4:

q='select balance from customers where id=%s and

username=%s'

cursor.execute(q,(i,name))

a=cursor.fetchall()

PAGE- 13
a=a[0]

for x in a:

print("Balance :- ",x)

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n')

elif ch==5:

c=0

else:

print("Wrong Option ")

print('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n')

interface()

elif choice==2:

print('Fill these details to register your account ')

idea=random.randint(1,100)

name=input("Enter your name :- ")

username=input('Enter your username :- ')

pas=int(input('Enter your password :- '))

balance=float(input('Enter your balance :- '))

age=int(input('Enter your age :- '))

gender=input('Enter your gender (M/F) :- ')

PAGE- 14
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,Account_no)

cursor.execute(query,value)

db.commit()

elif choice==3:

us=input("Enter your username :- ")

p=int(input("Enter your password :-"))

print('------------------------------------\n')

value=(us,p)

query="select * from customers where username=%s and password=%s "

cursor.execute(query,value)

data_login=cursor.fetchall()

cursor.execute('delete from customers where id=%s and

username=%s',(data_login[0][0],data_login[0][2]))

db.commit()

print('++++++++\nData deleted Succesful\n-------')

elif choice==4:

i='Select * from customers'

PAGE- 15
cursor.execute(i)

i=cursor.fetchall()

df = pd.DataFrame(i)

print(df)

elif choice==5:

print('Contact to your Nearest Branch\nOr Email:- bankofindia@gmail.com ')

print('==================================================\n\n')

elif choice==6:

bank=0

print('Thankyou for using Us')

else:

print('Wrong Option')

print('==========================================')

PAGE- 16
OUTPUT

PAGE- 17
PAGE- 18
PAGE- 19
PAGE- 20
BIBLIOGRAPHY

BOOKS:

 SUMITA ARORA-COMPUTER SCIENCE WITH


PYTHON
 ARIHANT- ALL IN ONE COMPUTER SCIENCE CBSE
INTERNET:

 WEBSITE: WWW.PYTHON.ORG
 WEBSITE: WWW.WIKIPEDIA.ORG

PAGE- 21

You might also like