def test spec price num for in enumerate spec start shorts for in spec

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
def test(spec, price):
num = [x[0] for x in enumerate(spec, start=1)]
shorts = [x[0] for x in spec]
counts = [x[1] for x in spec]
#
names = [price[x]['description'] for x in shorts]
cost = [price[x]['price'] for x in shorts]
total = [x[0]*x[1] for x in zip(counts, cost)]
return zip(num, names, counts, cost, total)