# 4. Making Comparisons

### Comparing Numbers

There are six possible comparisons that can be made in Python: `==` equal `>` greater than `<` smaller than `!=` not equal `>=` greater than or equal to `<=` smaller than or equal to

For example, we can make comparisons in Python between two numbers:

```python
1==1
>> True

5<0
>> False
```

In the above, by inputting `1==1` is same as asking Python this question: **Is 1 equal to 1”**? (The answer is yes.) The result of these comparison is a data type called **Boolean**, which has only two possible values: `True` or `False`.

{% hint style="info" %}
Note that `==` and `=` are not the same. \
`==` is used for comparison, while `=` is used for assigning a value to a variable.

```python
X = 4  #this is assigning the value 4 to variable X
X == 4 #this is asking Python to compare if variable X is equal to 4
```

{% endhint %}

### Comparing Strings

You can also compare if two strings are equal in Python.

```python
"a"=="A"
>> False
```

We can also ask Python to find out if a string is contained within a string using the “in” comparison operator.

```python
"H" in "Hello"
>> True

"h" in "Hello"
>> False
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eduapps.gitbook.io/python-intro/4.-making-comparisons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
