dic = {"1": register, "2": login, "3": transfer, "4": withdraw} # 建议采用字典
def main():
while True:
print("""
1.注册
2.登录
3.转账
4.提现""")
res = input("请选择功能:").strip()
if res in dic:
dic[res]()
else:
print("输入有误!")
转载于:https://www.cnblogs.com/tangda/p/10271842.html