Write a programBasic10 XPExercise 4/9

Even numbers up to a limit

Task

The program reads a non-negative whole number - a limit - and prints every even number from 0 up to and including the limit. You may separate the numbers with spaces or print each on its own line.

Examples

  • Input

    10

    Expected output

    0 2 4 6 8 10

Rules

  • Use a while loop in this lesson.

After you submit, 4 hidden tests will also check your solution: an odd limit, limit 0, limit 1, limit 30.

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.