PYTHON CORE · LESSON 14

Truth or falsehood

How the comparison works · about 11 minutes

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

Question with answer True or False

Знак > спрашивает: число слева больше? Python отвечает True — да, или False — нет.

print(7 > 3)

✦ The answer will be True.

STEP 2

Two equals

One = puts a value in a variable. Two = = = compare values.

points = 5
print(points == 5)

✦ The answer is True because the numbers are equal.

IN-CLASS PRACTICE

Type the code yourself

Dial the code. In the last line you need two signs =.

coins = 4
print(coins == 4)
Open the editor for class work
HOMEWORK

Solve it yourself

Сохрани 7 в score. Выведи результат проверки: score больше 5? Используй знак >, чтобы получить True или False.

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

Opening up your homework