# Expressions in Python

If you were to imagine Python to be a universe of its own, an expression would be the atom of this universe. An expression is the atomic unit of expression in Python.

### So, What is an Expression?

Expressions are representations of value in Python. Something like the expression `1+2` represents the value `3` in Python. Expressions are some combination of values, variables, operators, and function calls. Play around in the Python terminal with me, if you'd like to try a few expressions:

```python
>>> 1 + 2
3
>>> 1 - 2
-1
>>> 1/2
0.5
```

These are different from statements. Statements are a collections of expressions that together "do something". Expressions can be statements, but statements can't be expressions, if that makes any sense. Here's a few examples:

```python
>>> a = 3
>>> a
3
>>> a + 7
4

>>> def f(x): 
...    return x
>>> f(3)
3
```

Some of this syntax may not make sense to you — that's okay! Sometimes, a block of these statements do something unique and we wish them special names — like if statements, loops or functions. But the big idea to take away here is that **everything in Python is a collection of expressions and statements.**&#x20;


---

# 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://calnotes.gitbook.io/cs61a-guidebook/building-blocks/expressions-in-python.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.
