张三的银行账户 两个属性

编写银行账户类,该类具有用户名和余额两个属性,以及存款、取款方

创建该类对象,用户名为”张三”,余额为2000;
存入600,之后再取出1000
(查询余额

class bank(object):
    def __init__(self, username, balance):
        self.username = username
        self.balance = balance

    def cun(self, money):
        self.balance += money

    def qu(self, money):
        self.balance -= money


p1 = bank('张三', 2000)
p1.cun(600)
p1.qu(1000)
print(p1.balance)