1. enumerate 枚举函数 for i in enumerate(['a','b','c'],1): print(i)#(1, 'a')(2, 'b')(3, 'c') goods_lst= [ {'name':'电脑','price':1999}, {'name':'鼠标','price':20}, {'name':'美女','price':20}, ] for index,dic in enumerate(goods_lst,1): print(index,dic['name'],…