if __name__ == '__main__':print("定制手機套餐")print("")#定義電話時長:字典callTimeOptions={'1':'0分鐘','2':'50分鐘','3':'100分鐘','4':'300分鐘','5':'不限量'}key=input("請輸入電話時長的選擇編號:")value=callTimeOptions.get(key)if value:print(f"你選擇的時長為:{value}")else:print("輸入錯誤,請重新輸入")#定義流量包databag={'1':'0M','2':'500M','3':'1G','4':'5G','5':'無限量'}key=input("請輸入流量包的選擇編號:")value=databag.get(key)if value:print(f"你選擇的流量包是:{value}")else:print("輸入錯誤,請重新輸入")#定義短信條數:列表num=['1','2','3']messageSelect=["0條","50條","100條"]print("請輸入短信條數的編號是:")selectNum=input()print(f"你選擇的短信條數為:{messageSelect[int(selectNum)-1]}")#通過下角標訪問#輸出最終得到的3個結果print(f"您的手機套餐定制成功:免費通話時長為:每月{callTimeOptions[key]},流量為每月{databag[key]},短信條數為每月{messageSelect[int(selectNum)-1]}")