Python program to add accounts in a bank (Bank Management System)

Here, we will see a Python program for bank management system to add accounts and get their information.
Submitted by Shivang Yadav, on February 13, 2021

Problem Statement: Create a Python program to add accounts in a bank and get the information of all accounts in the bank.

Here, we will write a Python program that will take input from the user about details of the new account in the bank. And then print the information of each account and the total amount in the bank.

Steps to create the bank management system:

  • Step 1: Create a class named Bank that will store all the information and have methods to get and display account and balance details.
  • Step 2: Method: OpenAccount() takes account information form the user and feeds it to the object.
  • Step 3: Method: ShowAccount(), prints the account information.
  • Step 4: we will create objects of this class and get information. For multiple objects, we will store them into a data structure for reference.

Python Program to add accounts in a bank

class Bank:
    def OpenAccount(self):
        self.__acno=input("Enter Account Number: ")
        self.__name = input("Enter Name: ")
        self.__balance =int(input("Enter Balance: "))

        return self.__acno
    def ShowAccount(self):
        print("Account info: ", self.__acno,self.__name, self.__balance)

    def ShowBankBalance():
        print("Total Balance: ",Bank.bankbalance)
    def ShowBankBal(cls):
        print("Total Balance: ", cls.bankbalance)


   newAccount =Bank()
   key = newAccount.OpenAccount()
   ch=input("Add More y/n? ")

for newAccount in LC.values():


Enter Account Number: 101
Enter Name: Prem
Enter Balance: 10000
Add More y/n? y
Enter Account Number: 102
Enter Name: Shivang
Enter Balance: 20000
Add More y/n? y
Enter Account Number: 103
Enter Name: Mini
Enter Balance: 35000
Add More y/n? n
Account info:  103 Mini 35000
Account info:  101 Prem 10000
Account info:  102 Shivang 20000
Total Balance:  65000
Total Balance:  65000

Python class & object programs »


Comments and Discussions!


Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© some rights reserved.