"""
银行业务办理:
功能:查询余额,存款,取款,退出
"""
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)
python:银行卡业务办理
于 2023-08-04 00:54:24 首次发布