> For the complete documentation index, see [llms.txt](https://beesec.gitbook.io/python-zero-to-hero/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://beesec.gitbook.io/python-zero-to-hero/what-is-python/operators.md).

# Operators

Let's talk about operators. An operator is something between 2 variables / values and does something to them.

For example, the addition operator:

```python
x = 3 + 1
# x = 4
```

Python supports many maths operators:

```python
3 + 1
3 / 1 # divided by
3 * 4 # times
2 ** 2 # 2 to the power of 4
2 % 3 # 2 mod 3
```

Now the cool thing, operators don't just work on numbers. They work on strings too. And lists. And dictionaries.

```python
[3, 2] + [6, 7]
# [3, 2, 6, 7]
"Hello, " + "World!"
# "Hello, World!"
```

Well, **operators work on any data structure that has implemented a magic method for them**.

Magic methods are rather wild, but require prequesite knolwedge of object orientated programming fiest.
