REFERENCE What can be the most efficient way to store and retrieve this type of table.
| Product | Category | Original Price | Discount(%) |
|---|---|---|---|
| First | Stationary | 1000 | 10 |
| Second | Clothing | 2000 | 5 |
stationary_items =[]
stationary_items.append({"Product" : "NOTEBOOK", "Category" : "STATIONARY", "Price" : 200, "Discount" : 20})
stationary_items.append({"Product" : "PENS", "Category" : "STATIONARY", "Price" : 300, "Discount" : 10})
stationary_items.append({"Product" : "MARKERS", "Category" : "STATIONARY", "Price" : 500, "Discount" : 5})
clothing_items = []
clothing_items.append({"Product" : "TSHIRT", "Category" : "CLOTHING", "Price" : 1000, "Discount" : 10})
clothing_items.append({"Product" : "JACKET", "Category" : "CLOTHING", "Price" : 2000, "Discount" : 5})
clothing_items.append({"Product" : "CAP", "Category" : "CLOTHING", "Price" : 500, "Discount" : 20})
I have to make queries later like if product is notebook then do something edit : I cannot use 3rd party libraries,
list.appendcan only have one parameter at a time. BTW, you may need to usepandas.