Python Compare & bool
n > 10Practice

Comparisons give True or False

n > 10 is a yes/no question. Python answers with the boolean True or False — like a light switch, not the words "yes" and "no".

Picture this: ask the type

bool is True or False. type() tells you what kind of box you have.

value42 or True
→
type(...)inspect the box
→
int / bool / strthe answer

In easy words: What is boolean output?

A boolean is a yes/no value in code: True or False. Comparisons like n > 10 return a boolean.

Where booleans are used

Used in login checks, access control, validation rules, feature toggles, and every decision-making condition in apps.

Real world: theme park fast pass

If loyalty points > 10, the gate opens (True). Otherwise you wait in the normal line (False). Change points below and watch the gate.

points > 10 ?

🚧
Gate closed
print(n > 10)
True

Practice matches this

  • Input one integer n, print n > 10.
  • 15 → True, 4 → False, 10 → False (not greater, only equal).

Example Program

1n = int(input())
2print(n > 10)