I am wondering if I can replace values of a list with elements of another list based on the index in Python:
let's say
a=[3, 2, 8, 7, 0]
d=['a','b','c','d','e','f','g','h','i']
I want to replace the elements of list a with the elements of list d. Values of list a define the index number of list d.
I want a list like c,
c=['d','c','i','a']
a, which consists of using that element as an index intod. Clearly we know how to write that: by indexing with[]. The next trick is to repeat that calculation for the elements ofa, and collect them intoc. Please see the linked duplicate for this technique.