Even numbers
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
Even numbers
Print the even numbers from 2 to 20, one per line.
range can take a third number, the step: range(0, 10, 3) counts 0, 3, 6, 9. Start at the first even number and step by 2.
Print the even numbers from 2 to 20, one per line. Use range with a step: range(start, stop, step).
Click Run to see the output here.