def account_info(): pass def repay(): pass menu = ''' ------- 請選擇以下選單 --------- 1. 賬戶資訊 2. 還款 3. 取款 4. 轉賬 5. 賬單 6. 退出 ''' # 將函式存盤在字典中 menu_dic = { '1': account_info, '2': repay, '3': withdraw, '4': transfer, '5': pay_check, '6': logout, } exit_flag = True while exit_flag: print(menu) user_option = input(">>:").strip() # 根據各戶選擇的選單來運行對應的函式處理 if user_option in menu_dic: menu_dic[user_option]() else: print("選擇錯誤!")
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/156491.html
標籤:Python
下一篇:月考二
