btpoole
11 years agoChannel Surfer
Array Range
Is there any way to extract a set number of values stored in an array. For example in the the array myarray I only want the first 10 entries in the array. Thanks
>>> a = [00,11,22,33,44]
>>> a[2:4]
[22, 33]
>>> a[3:]
[33, 44]
>>> a[:-2]
[0, 11, 22]
>>> a[::-2]
[44, 22, 0]