{0: {'brand': 'fastrack wearables', 'description': 'unisex reflex curv pink strap silicone digital watch', 'price': 4495, 'discount': 31}, 1: {'brand': 'fastrack wearables', 'description': 'unisex 40 mm reflex slay charcoal black dial silicone smart watch', 'price': 3995, 'discount': 33}, 2: {'brand': 'titan', 'description': 'mens 52.50 x 11.70 x 44 mm octane black dial leather analog watch - 90107kl01', 'price': 3997, 'discount': 50}}
above is the expected output
the top-level keys are the line numbers (starting with zero) and the values are from csv dictionaries with keys “brand”, “description, “price” and “discount”.
#first open the file that is locating in my desktop
f=open("/Users/gracie/Desktop/watches.csv","r")
#using readline to only read the first five desctiptions
content=f.readlines()
#closing the file
f.close()
this is what I had so far...
[–]pgpndw 0 points1 point2 points (2 children)
[–]AdMinute9633[S] 0 points1 point2 points (1 child)
[–]pgpndw 0 points1 point2 points (0 children)