图片是要求,那么开始做吧。
product_list = ["1.iphone6s 5800元","2.mac book 9000元","3.coffee 32元","4.python 80元","4.bicyle 1500元"] salary = input("请输入你的工资是多少>>>") print ("你的工资是:",salary) while True: print(product_list) product_code = input("请输入你要购买的产品编码>>>") if product_code == 1: if salary>5800: print("恭喜购买成功")