Write a programExercise 2/4Elementary20 XP

A list backwards without reverse

Task

The input is a line of numbers separated by spaces. The program stores them in a list and prints it backwards - on one line, separated by spaces.

Use indexes and a loop - do not use the reverse method, the reversed function or a slice with a negative step such as [::-1].

Examples

  • Input

    1 2 3 4

    Expected output

    4 3 2 1

Rules

  • Walk the list from the end with indexes - no reverse, reversed or [::-1].

After you submit, 4 hidden tests will also check your solution: one item, repeated items, negative numbers, a longer list.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.