0% found this document useful (0 votes)
12 views

Python Is

This document discusses a bank management system built using Python and MySQL. The system allows users to perform basic banking tasks like creating accounts, depositing and withdrawing money, checking balances, and closing accounts. It connects to a MySQL database to store customer and transaction data. Functions are defined to handle each banking task by querying the database and committing changes back to it. The main menu drives the program by calling the appropriate function based on the user's input choice.

Uploaded by

druvegamer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Python Is

This document discusses a bank management system built using Python and MySQL. The system allows users to perform basic banking tasks like creating accounts, depositing and withdrawing money, checking balances, and closing accounts. It connects to a MySQL database to store customer and transaction data. Functions are defined to handle each banking task by querying the database and committing changes back to it. The main menu drives the program by calling the appropriate function based on the user's input choice.

Uploaded by

druvegamer
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Python is an interpretable, object-oriented, high-quality

programming language with dynamic semantics. The higher


the
Built in data structure, combined with dynamic typing and
dynamic binding, makes it very attractive for Rapid
Application
development, as well as use as a scripting or glue language to
connect existing components. Python’s simple and easy-to-
use syntax emphasizes readability and therefore reduces
program maintenance costs. Python supports modules and
packages, which encourage program modularity and code
reuse. The extensive library of Python definitions and
standards is available for all major platforms in source or
binary form for free, and can be freely distributed.
Programmers generally like Python because of its high
performance. With no compile step, the edit, check, and
debug cycle is incredibly fast. Python programs are easy to
set up: a mistake or bad input will never cause a partition
error. Rather, when the translator detects an error, it raises an
exception. If the program does not catch an 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.
ABOUT MYSQL:
MySQL is a fast, easy to use RDBMS. MySQL is developed,
marketed and supported by MysQL AB, Which is a Swedish
company. MysQL is so popular for many good reasons:
• MySQL is released under an open-source license. So you
don’t have to pay anything to use it.
• MySQL is a very powerful program in its own right. It
handles the functionality of the most expensive and powerful
database packages.
• MySQL uses the format of the well-known SQL data
language.
• MySQL runs on many operating systems and is available in
several languages including PHP, PERL, C, C++, and JAVA.
• MySQL works very fast and performs well even with large
data.
• MySQL is very friendly to PHP, the most recommended
language for web development.
• MySQL supports large databases, 50 million rows or more
per table. The default file size limit for the table is 4GB, but
you can increase this fif your operating system can handle it)
to a theoretical limit of 8 million terabytes (B).
• 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.
import mysql.connector as mysql
con=mysql.connect(host="localhost",user="Akshat",passwd=
"12345678",database="bank")
def openAcc():
n = input("Enter Name : ")
ac = input("Enter Account No: ")
db = input("Enter D.O.B: ")
p = input(“Enter Phone No : “)
ad = input("Enter Address: ")
ob = int(input("Enter Opening Balance : "))
data = (n,ac,db,p,ad, ob)
data1 = (n,ac,ob)
sql = 'insert into account values(%s,%s, %s, %s, %s, %s)'
sql1 = 'insert into amt values(%s,%s, %s)'
c = con.cursor()
c.execute(sql,data)
c.execute(sql1,data1)
con.commit()
print("Data Entered Successfully")
main()
def depAmo():
am = int(input("Enter Amount: "))
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()
tam = myresult[0] + am
sql =" update amt set balance = %s where accno = %s"
d = (tam,ac)
c.execute(sql,d)
con.commit()
main()

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

You might also like