> For the complete documentation index, see [llms.txt](https://hopemoore.gitbook.io/coding-for-creatives-spring-2021/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hopemoore.gitbook.io/coding-for-creatives-spring-2021/glossary-and-terms/operators/relational-operators.md).

# Relational Operators

Many if statements compare values

Use the operators below to compare values:

|                          | Operator     | Example(s)                                                                                                                                      |
| ------------------------ | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| is equal to              | `==`         | <p><code>if (name == "Betty") { ... }</code></p><p><code>if (x == 0) { ... }</code></p><p><code>if x == 1: ...</code></p>                       |
| is not equal to          | `!=` or `<>` | <p><code>if (name != "Alan") { ... }</code></p><p><code>if (num != 5) { ... }</code></p><p><code>if num != 2: ... or if num <>2: ...</code></p> |
| lesser than              | `<`          | <p><code>if (count < 10) { ... }</code></p><p><code>if count < 10: ...</code></p>                                                               |
| greater than             | `>`          | <p><code>if (length > 3.4) { ... }</code></p><p><code>if length > 3.4: ...</code></p>                                                           |
| lesser than or equal to  | `<=`         | <p><code>if (points <= 100) { ... }</code></p><p><code>if points <= 100: ...</code></p>                                                         |
| greater than or equal to | `>=`         | <p><code>if (width >= 6.2) { ... }</code></p><p><code>if width >= 6.2: ...</code><br></p>                                                       |
