Challenge: Get One Dimensional Array Using Slice and Only Positive Indexes Challenge: Get One Dimensional Array Using Slice and Only Positive Indexes

Let's look at the syntax of slicing: array[start:end:step] respectively:

  • start - the index from which to start slicing.
  • end - the index at which the slicing ends (! this index is not included).
  • step - this parameter determines the increments between the indices.

Task

Consider the following array [11, 5, 87, 1, 44, 11, 6, 0, -5].
You have to get such an array [87, 11, -5].
Use slice and ONLY POSITIVE indexes.

Everything was clear?

Section 3. Chapter 7
toggle bottom row