# setup()

### Example

<figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2FbssqByAGomo6kW83FFkz%2Fsetup2().gif?alt=media&#x26;token=9312cb96-4fa4-4e7d-9957-a29a73682f53" alt=""><figcaption></figcaption></figure>

```python
def setup():
 background("grey")

def draw():
  fill(255,79,132)
  circle(mouseX,mouseY,100)
```

### Syntax

`setup()`

### Description

The setup() function is called only **once at the beginning** of the program. Its purpose is to set up the **initial environment** of the program, such as canvas size, background color, to load media such as images and fonts as the program starts and any other initial values that the program needs.&#x20;

The `setup()` function takes no arguments, and must be defined in the program before the `draw()` function.

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}
