I want to create a dictionary out of a given list, in just one line. The keys of the dictionary will be indices, and values will be the elements of the list. Someth
With another constructor, you have
a = [51,27,13,56] #given list d={i:x for i,x in enumerate(a)} print(d)