Write a programBasic10 XPExercise 12/15

Entered values reversed

Task

The user enters whole numbers. The user enters the numbers one per line and ends with -1, which is not part of the result.

The program prints the list of entered numbers and below it a list with the same numbers in reverse order.

Examples

  • Input

    1
    2
    3
    -1

    Expected output

    [1, 2, 3]
    [3, 2, 1]

After you submit, 3 hidden tests will also check your solution: no numbers, negative numbers, one number.

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.