Simple question about Python lists

Eric eric.shain at
Tue Nov 11 20:47:53 CET 2008

I'm learning Python (while coming from MATLAB). One question I have is
that if I have a list with say 8 elements, and I want just a few of
them how do I select them out. In MATLAB, if I just want the first,
fifth and eighth element I might do something like this:

b = a([1 5 8]);

I can't seem to figure out a similar Python construct for selecting
specific indices. Any suggestions?



More information about the Python-list mailing list