I have a dictionary with multiple keys but I only need to print part of it, i don’t know how to do it though.
The output i have for my dictionary is:
[{'vin': '4T1R11AK7NU637019', 'askPrice': 28106.0, 'msrp': 28106.0, 'mileage': 0.0, 'isNew': True,
'firstSeen': '2021-11-28', 'lastSeen': '2021-11-28', 'modelName': 'CAMRY', 'brandName': 'TOYOTA', 'year': 2022.0,
'dealerID': 30873, 'color': 'Celestial Silver Metallic', 'interiorColor': 'Black', 'vinDecode': {(A LOT OF THINGS IN HERE}}},
{'vin': '4T1G31AK7NU45B292', 'askPrice': 0.0, 'msrp': 0.0, 'mileage': 0.0, 'isNew': True,
'firstSeen': '2021-11-28', 'lastSeen': '2021-11-28', 'modelName': 'CAMRY', 'brandName': 'TOYOTA', 'year': 2022.0,
'dealerID': 12750, 'color': 'N/A', 'interiorColor': 'N/A', 'vinDecode': {(A LOT OF THINGS IN HERE}}}]
So there are multiple vins and i would just like to print from vin to interiorColor for every entry; completely ignoring the vinDecode part. Is there any way I could do it?
>Solution :
You can use .pop() on the dictionary to remove data:
for item in items:
item.pop("vinDecode")
print(item)