inventory = {'A':['Toy',3, 1000], 'B':['Toy',8, 1100],
'C':['Cloth',15, 1200], 'D':['Cloth',9, 1300],
'E':['Toy',11, 1400], 'F':['Cloth', 18, 1500], 'G':['Appliance', 300, 50]}
The alphabets are name of merchandise, the first field in the [] brackets are category of the merchandise, the second field in the [] brackets are price, the third are numbers sold.
I would like the price to be increased by 1 so the result would look like.
inventory = {'A':['Toy',4, 1000], 'B':['Toy',9, 1100],
'C':['Cloth',16, 1200], 'D':['Cloth',10, 1300],
'E':['Toy',12, 1400], 'F':['Cloth', 19, 1500], 'G':['Appliance', 301, 50]}
Then what would be a good way to loop through to find any item whose price is $19.
I am not good at lambda function. Could you please give me some explanation of your code so that I could manipulate for future use? Thank you