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)