摘要: shoplist = ['apple', 'mango', 'carrot', 'banana'] #定义一个列表print 'I have', len(shoplist),'items to purchase' #计算列表长度print 'These items are:', #遍历列表for item in shoplist: print item, print '\nI also to buy rice'shoplist.append('rice' 阅读全文
posted @ 2013-05-15 09:23 hnrainll 阅读(712) 评论(0) 推荐(0) 编辑