Loading...
Loading...
Loading...
A warehouse keeps stock on n shelves numbered 1 to n, and only the even-numbered shelves are in use today. Print the even shelf numbers in order, one per line.
Example
Input
7
Output
2 4 6
The even numbers up to 7 are 2, 4 and 6.
Try the problem first. Open one hint at a time.
Start the counter at 2 and move it forward in steps.
range can take a third value that is the step.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor