Simple Bank through class Program in Python

Python
Python


Code:

class Account:
    def __init__(self,account_holder,amount):
        self.account_holder = account_holder
        self.amount = amount
    def info(self):
        print("This account belongs to: ",self.account_holder)
        print("IT has a balence of: ",self.amount)
    def account_info(self):
        print(self.account_holder)
        print(self.amount)
obj1 = Account("Mr. A",30000)

Output:

>>> obj1.account_holder
'Mr. A'
>>> obj1.amount
30000
>>> obj1.info()
This account belongs to:  Mr. A
IT has a balence of:  30000
>>> obj1.account_info()
Mr. A
30000
>>> 

Tags: python,python programming,atm machine program in python,python tutorial,python (programming language),simple python program tutorial,simple python program,simple python programs for kids,python simple program,bank management system project in python,python sample program,programming in python,class,atm machine program using python,how to write atm program using python,python exercise program,python program

Post a Comment

Previous Post Next Post