Comparison Operators

Challenge 1-2: Maths

In Python, we can do a lot of things with numbers besides just adding or dividing.

What if we need to find out if one number is larger than another? Or if one number is equal to another? Suppose you're making a video game with Python - you might want to do something like this to compare scores between two players, for example.

Well, here are some more symbols (or operators) that we can use. These are called comparison operators.

Operators
equal to ==
not equal to !=
less than <
greater than >
less than or equal to <=
greater than or equal to >=

Later on, you'll see some examples of how these can be used in programming. But for now, let's look at how these comparisons work.