Reverse

Report a typo

In this task, we have a list numbers = [2, 4, 6, ...] and a line that is supposed to choose elements with indices from 4 to 16 inclusively in reverse order, but a mistake has been made. Find and fix it.

With a negative step, your start index should be greater than the stop index. Choose the stop index carefully. Due to reverse order, you might want to decrease it by one in order to include the last element in your slice.
Write a program in Python 3
# the following line reads the list from the input; do not modify it, please
numbers = [int(num) for num in input().split()]

print(numbers[4:16:-1]) # the line with an error
___

Create a free account to access the full topic