Drop hier links of afbeeldingen om ze aan de editor toe te voegen.

Another modify task, and this time the counter’s value ends up in the output, so the range has to be exactly right.

The editor starts you off with a loop that numbers its own lines:

for counter in range(1, 11, 1):
    print("This is line " + str(counter))

Run it first. The counter takes the values 1 to 10, and each line says which one it is on.

Your task

Change the program so that it prints the even numbers from 2 to 8, each one described as an even number.

The output

Four lines, where NUMBER is the value of the counter on that time round:

NUMBER is an even number.

Example

Output:

2 is an even number.
4 is an even number.
6 is an even number.
8 is an even number.

The full stop at the end of each line is part of it.

Help! My code doesn't work!

Make sure that you check for the following things:

  • The range has three numbers: where to start, where to stop, and the step.
  • The stop value is never reached, so a range that stops at 8 never prints the 8.
  • The counter is still wrapped in str() before it is joined onto text with a +.
  • The space between the number and the word is comes from inside the string.
  • Every line ends with a full stop.