Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

list to dict 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'}
 
PREVIOUS NEXT
Tagged: #list #dict #python
ADD COMMENT
Topic
Name
2+6 =