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

Repeat a set number of times

Try as many times as you need

Let’s understand

for steps through a sequence. range(3) gives 0, 1, 2: the end is excluded. range(1, 4) gives 1, 2, 3. The loop variable takes the next number each time.

Listen to the explanation

Example

for i in range(2):
    print("PING")
YOUR MISSION

Print SCAN four times on separate lines using for.

I need a hint

range(4) gives four repetitions.

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.