Countdown by Twos
Completed
Read an even number n and print n, n-2, … down to 0 on one line separated by spaces.
Input
One even integer.
Output
One line.
Example
Input
10
Output
10 8 6 4 2 0
Editor
Python
Hints
range(start, stop, step) can count down with a negative step.
print(*items) prints items separated by spaces.
Solution explanation
The * unpacks the range into separate arguments for print.
Show solution
n = int(input())
print(*range(n, -1, -2))