标签:odi opp phone hone \n ping int iphone x you
#!/usr/local/bin/python3 # -*- coding:utf-8 -*- balance=int(input("Please input your salary:")) Merchandise_list=[[1,‘Mac pro‘,16888],[2,‘Iphone x‘,7888],[3,‘Ps4 pro‘,4000]] shopping_list=[] while True: print(‘Merchandise list:\n‘) for x in Merchandise_list: print(x) num=input("which one do you want?-->") if num!=‘q‘: if balance>=Merchandise_list[int(num)-1][2]: balance-=Merchandise_list[int(num)-1][2] shopping_list.append(Merchandise_list[int(num)-1]) print("your balance:",balance) else: print("your balance:",balance) print("your balance was inadequate!") else: print("your shopping list:", shopping_list) print("your balance:", balance) print("Looking forward to your next visit~") break
标签:odi opp phone hone \n ping int iphone x you
原文地址:https://www.cnblogs.com/octopuszy/p/8986701.html