fork download
  1. product = [["冰箱", 2199], ["电饭煲", 399], ["洗衣液", 59], ["吹风机", 129]]
  2. for item in product :
  3. print("商品:{},价格:{}".format(item[0],item[1]))
  4.  
  5.  
  6. #1.2删除列表中第二个商品,并在末尾追加 1 个新商品,输出最终列表。(15 分)
  7.  
  8. del product[1]
  9. product.append (["空气炸锅", 499])
  10. print("修改后商品列表:",product)
Success #stdin #stdout 0.07s 14076KB
stdin
Standard input is empty
stdout
商品:冰箱,价格:2199
商品:电饭煲,价格:399
商品:洗衣液,价格:59
商品:吹风机,价格:129
修改后商品列表: [['冰箱', 2199], ['洗衣液', 59], ['吹风机', 129], ['空气炸锅', 499]]