1. #!/usr/bin/python 
  2. #2011/09/16 by larry 
  3. import sys 
  4. shoplist=['apple','banana','mango','carrot'] 
  5. buylist=[] 
  6. print 'These item are:' 
  7. for item in shoplist: 
  8.         print item 
  9. while True: 
  10.         call=raw_input("choose you want to buy:") 
  11.         if call=='quit':break 
  12.         else:  
  13.                 if call not in shoplist: 
  14.                         print 'shoplist is not your choose!!' 
  15.                         pass 
  16.                 else: 
  17.                         shoplist.remove(call) 
  18.                         buylist.append(call) 
  19.                         if len(shoplist)==0:break 
  20. if len(shoplist)==0:print 'the shoplist is empty!' 
  21. else: 
  22.         print 'the rest of shoplist as follows:' 
  23.         for rest in shoplist:print rest, 
  24.         print  
  25. if len(buylist)==0: 
  26.         print 'your buylist is empty!' 
  27. else: 
  28.         print 'your buylist have:' 
  29.         for buy in buylist: 
  30.                 print buy,