I have the following list
bar = [\'a\',\'b\',\'c\',\'x\',\'y\',\'z\']
What I want to do is to assign 1st, 4th and 5th values of bar>
In numpy, you can index an array with another array that contains indices. This allows for very compact syntax, exactly as you want:
In [1]: import numpy as np
In [2]: bar = np.array(['a','b','c','x','y','z'])
In [3]: v1, v2, v3 = bar[[0, 3, 4]]
In [4]: print v1, v2, v3
a x y
Using numpy is most probably overkill for your simple case. I just mention it for completeness, in case you need to do the same with large amounts of data.