# draw()

### Example

<figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2FGivJM4zXE7RcA6ewq1vf%2Fdraw().gif?alt=media&#x26;token=f960aca7-9870-4336-8863-71e6c7f91e45" alt=""><figcaption></figcaption></figure>

```python
def setup():
  createCanvas(400,400)

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

### Syntax

`draw()`

### Description

The `draw()` function is automatically called **continuously** at a fixed time interval (by default, 60 times per second) as long as the program is running. It is first called immediately after the **setup()** function.

The number of times draw() executes in each second may be controlled with the **frameRate()** function.

Inside the `draw()` function, you can use a variety of p5 Python functions to draw shapes, lines, and text on the canvas, as well as manipulate the color, position, and size of these elements. You can also use variables to create animations or interactive elements that respond to user input.

{% 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 %}
