Write a python class to implement a Bank which which supports basic operations like depoist, withdrwa, overdrawn


Topic: Write a python class to implement a Bank which which supports basic operations like depoist, withdrwa, overdrawn

Solution

class BankAccount(object):
    def __init__(self, account_no, name, initial_balance=0):
        self.account_no = account_no
        self.name = name
        self.balance = initial_balance
    def deposit(self, amount):
        self.balance += amount
    def withdraw(self, amount):
        self.balance -= amount
    def overdrawn(self):
        return self.balance < 0
		
		



List all Python Programs