Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Comparison Operators | True or False?
Data Types in Python

book
Challenge: Comparison Operators

Task

Swipe to start coding

Here, you are going to cope with the task that boosts your logical skills.

Enter numbers to fields to make all statements True.

Solution

# All statements must be `True`
statement1 = 0 == 0
statement2 = 1000 >= 800
statement3 = 9 <= 2800

# Print these statements
print(statement1)
print(statement2)
print(statement3)

Note

You use boolean logic almost every day, but in a way that is normal for you. For instance, if you say, "I am older than my sister", it can be represented as my age > sister's age. Or if you say, "My mom's and my hobbies are distinct", it means my hobbies != mom's hobbies.

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 2
# All statements must be `True`
statement1 = 0 == ___
statement2 = ___ >= 800
statement3 = ___ <= 2800

# Print these statements
print(statement1)
print(statement2)
print(statement3)
toggle bottom row
some-alt