dict to list python

my_list = ['Nagendra','Babu','Nitesh','Sathya']
my_dict = dict() 
for index,value in enumerate(my_list):
  my_dict[index] = value
print(my_dict)
#OUTPUT
{0: 'Nagendra', 1: 'Babu', 2: 'Nitesh', 3: 'Sathya'}

Here is what the above code is Doing:
1. We have a list of strings.
2. We create an empty dictionary.
3. We use enumerate() to get the index and value of each element in the list.
4. We add the index as the key and the value as the value to the dictionary.
5. We print the dictionary.