# draw()

### Example

<figure><img src="/files/rqrg1CiM1fcwNkRMljen" 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 %}


---

# 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://learnpython.strivemath.com/p5-python-web/reference/controlling-the-environment/draw.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.
