Please use a meaningful subject.

On 22.03.2013 13:37, Arijit Ukil wrote:
I have the following data points.
data = [1,2,0,9,0,1,4]
I like to store in an array and print the odd-indexed points, i.e. 2, 9,1
(considering index starts at 0)

You can simply slice your list:

>>> data = [1, 2, 0, 9, 0, 1, 4]
>>> number_list = data[1::2]
>>> number_list
[2, 9, 1]

See also
http://docs.python.org/3/library/stdtypes.html#common-sequence-operations

Bye, Andreas
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to