I wanted to enumerate dictionary items that are in a json file. offers.json { "offer": [ {"bleach": 14 , "tshirt": 25, "notebook": 6, "mayo": 3, "kiwi": 11, "perfume": 68, "hat": 2, "toy": 17} ] } python file import json with open("offers.json",'r')as f: offer=json.load(f)['offer'] for i, (key, value) in enumerate(offer.items()): print(f"{str(i + 1)} {key} {value:02} $") output AttributeError: 'list' object has no attribute 'items' Continue reading...