a=input('please input your salary:') purchase=[] while True: products=[[1,'iphone',5800],[2,'book',50],[3,'bike',800],[4,'coffee',40]] for i in products: print i b=raw_input('please input the thing what you want buy(put Q or q to end):') if b.upper()