I have dictionary like this:
a = {"RAM": ["25GB", "256GB"], "Storage": ["25GB"]}
and is there any possible way to make dictionary like this?
wanted_dict = [{"title":"RAM", "items":["25GB", "256GB"]}, {"title":"Storage", "items":["25GB"]}]
i tried to do with for loop but with no result. any advices?
wanted_dict = [{"title": key, "items": value} for key, value in a.items()]. Whereais the name of your dictionary.