I have a list
items=["apple","carrot","bike","dog"]
The result I want
ordered_items = {"fruit": items[0],"vegetable":items[1],"vehicle":items[2],"animal":items[3]}
print(ordered_items)
{
"fruit": "apple","vegetable":"carrot","vehicle":"bike","animal":"dog"
}
Here I have to explicitly mention the index from the list(items) in the resultant dictionary(ordered_items) which is definitely not the right approach when the list(items) gets updated in the future.
Is there any alternative way I can form in key-value pair by using for-loop/count or something?