Answers for "bank account program in python oop"

0

bank account program in python oop

class Bank:

    def __init__(self,name,balance=0):
        self.name = name
        self.balance = balance

    def withdraw(self,amount):
        if amount<self.balance:
            self.balance -= amount
            print(self.name,self.balance)
            
        else:
            print("Not Enough Money for Withdraw...\nYour account has",self.balance,".")

    def deposit(self,amount):
        self.balance += amount
        return self.balance



b = Bank("Zulqarnain")
b.deposit(1000)
b.withdraw(200)
Posted by: Guest on July-29-2021

Code answers related to "bank account program in python oop"

Python Answers by Framework

Browse Popular Code Answers by Language