python:银行卡业务办理

"""
银行业务办理:
功能:查询余额,存款,取款,退出
"""
def StartScreen():# 开始界面
    global name
    name = input("请输入您的姓名:")


def FunctionScreen():# 功能选择界面
    global choice
    print(f"{name}(先生/女士)您好,欢迎使用本台ATM,请选择操作:")
    print("余额\t[输入1]",end="\t")
    print("存款\t[输入2]")
    print("取款\t[输入3]",end="\t")
    print("退出\t[输入4]")
    choice = int(input("请输入您的选择:"))
    while choice<1 or choice>4:
        choice = int(input("请输入您的选择:"))
    return choice


def search():# 查询余额
    print(f"您当前余额为:{money}")


def save():# 存款
    global money
    money_save = float(input("您的存款金额为:"))
    money = money + money_save
    print(f"您当前余额为:{money}")


def withdrawal():# 取款
    global money
    money_withdraw = float(input("您的取款金额为:"))
    money = money - money_withdraw
    print(f"您当前余额为:{money}")

def exit():# 退出
    print("结束操作,退出操作界面")
    StartScreen()

while True:
    import random
    money = random.randint(0,10000)
    StartScreen()
    while True:
        choice = FunctionScreen()
        if choice == 1:
            search()
        if choice == 2:
            save()
        if choice == 3:
            withdrawal()
        if choice == 4:
            exit()
            money = random.randint(0,10000)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值