CurriculumPython if, elif and else for KidsAsking questions about numbers
Python Comparison Operators: >, <, ==, and True/False
True or False — how the dragon tests a value before deciding anything.
Asking questions about numbers
Before the dragon can DECIDE anything, it needs to ASK a question. That's what comparisons do.
Comparing two things gives you an answer of True or False. Nothing else — just those two words.
print(80 > 50)Output
TrueFlip the numbers and you might flip the answer.
print(30 > 50)Output
FalseCareful with 'at least' or 'at most' — the boundary matters. > leaves the exact number OUT.
strength = 50
print(strength > 50)Output
False>= means 'greater than OR equal to'. That includes the boundary.
strength = 50
print(strength >= 50)Output
TrueAnd checking if two things are EQUAL uses two equals signs, not one — one = is for filling a box.
gold = 100
print(gold == 100)Output
TrueCheck your understanding
health is exactly 20. What does print(health > 20) say?
health = 20
print(health > 20)Why: 20 is not bigger than 20, so print(health > 20) says False. > is strict — the boundary itself does not count. That's what >= is for.
gold = 5. What does print(gold = 5) do — with ONE equals sign, inside print?
gold = 5
print(gold = 5)Why: A single = always means assignment, never a question — Python won't let you use it to compare. That's exactly why == exists: two equals signs specifically for asking 'are these the same?'
What you'll practice
The dragon's strength is 80. Ask Python: is that MORE than 50? print() the answer — Python already knows how to say True or False.
More from this topic
Asking questions about numbers is one lesson inside Python if, elif and else for Kids — see the full lesson order and what the whole topic covers.
View the full topic →