#_author:Ltx
#date:2019/12/16
import time
import random
class account:
'''
1.存款功能
2.取款功能
3.打印交易详情
3.1--每次交易的时间
3.2--存款或者取款的金额
3.3每次交易后的金额
'''

def __init__(self,balance=10000):
self.balance=balance
@property
def show(self):
flag = True
while flag:
msg = '''
1. 存款
2. 取款
3. 退出
'''
print('请选择你要使用的功能:',msg)
choose=int(input('请选择:'))
if choose==1:
self.deposit
elif choose==2:
self.withdrawal
elif choose==3:
flag=False
else:
print('您输入有误')
@property
def deposit(self):
inp=input('请输入你要存款的金额:')# Please enter the amount you want to deposit
inp=int(inp)
print('您存入的金额为',inp,time.ctime())
self.balance+=inp
print('您的余额是',self.balance)
@property
def withdrawal(self):
re=int(input('请输入你要取的金额:'))
if re<self.balance:
self.balance-=re
print('取款成功,您的余额为:',self.balance,time.ctime())
else:
print('余额不足,您的余额为:',self.balance,'请重新输入取款金额')
flag=False
a1=account()
a1.show

12-15 15:41