PYTHON CORE · LESSON 22

At least one.

or · about 10 minutes

Learning with progressRead the summary for free. To save the work, log in to the account.
STEP 1

One answer from «да» is already coming.

or connects checks. If one is correct, the general answer is True.

day = 6
print(day == 6 or day == 7)

✦ 6 is a day off, so True.

STEP 2

You can choose from two.

With the help of or, the program learns whether one of the two values is suitable.

color = "синий"
if color == "синий" or color == "зелёный":
    print("Люблю")

✦ «Люблю» will appear.

IN-CLASS PRACTICE

Type the code yourself

Set an example. Provided two checks and the word or.

day = 7
print(day == 6 or day == 7)
Open the editor for class work
HOMEWORK

Solve it yourself

Save 2 to day. Is day equal to 1 or equal to 2? Use or.

The answer is hidden. Use similar examples from the lesson notes.

Opening up your homework