What about slicing instead? This is a separate issue from indexing. The main problem here is that if you include the upper bound then you cannot express the empty slice. Also it is elegant to print the first n elements as a[:n]. Slicing a[i:j] excludes the upper bound, so it probably easier to understand if we express it as a[i:i+n].