Мой профиль
ACTIVITY 23 / 50

Every second signal

Try as many times as you need

Let’s understand

The % operator returns the remainder after division. If n % 2 equals 0, n is even. A condition inside a loop lets you react only on selected steps. This combines repetition with a decision.

Listen to the explanation

Example

print(7 % 3)
YOUR MISSION

Loop through 1 to 6. Print only the even numbers: 2, 4, 6.

I need a hint

range(1, 7) includes 6. Inside, check n % 2 == 0.

How to find an error
  1. Read the last line of the error message.
  2. Find the indicated line. Check quotes, parentheses and indentation.
  3. Change one thing and run again.

main.py

4 spaces

Your draft stays in this browser.

Result

Python
Your program’s output will appear here. Click Run.