1.V.001
小马银行:使用文件夹保存当前信息,有记录
# 账户类
class Account():
def __init__(self, name, password, balance, operation):
self.name = name
self.password = password
self.balance = balance
self.operation = operation
print(self.name, "账户" + self.operation + "成功")
# 查询余额
def check(self):
print("当前余额:", self.balance)
# 存钱
def save(self, money):
self.balance += money
self.operation = "存入" + str(money)
# 取钱
def withdraw(self, money):
if money <= self.balance:
self.balance -= money
self.operation = "取出" + str(money)
else:
print("没钱还想来得瑟")
# 记录
def record(self):
f = open(self.name + ".txt", "a")
text = self.name + "," +