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("输入有误!")