Conditions and Loops
Use if to choose and for to repeat. The modulo operator % gives the remainder.
Example
for n in range(3):
if n == 1:
print("one")
Your task
Print only the even numbers from 0 to 4.
Python Foundations
Use if to choose and for to repeat. The modulo operator % gives the remainder.
for n in range(3):
if n == 1:
print("one")
Print only the even numbers from 0 to 4.
This lesson is checked against the lesson rules. Your code is never run on our servers.