> For the complete documentation index, see [llms.txt](https://docs.bdb.ai/bdb-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bdb.ai/bdb-documentation/data-science-lab/various-tabs-to-work-with/notebook/notebook-page/notebook-cells/using-a-code-cell.md).

# Using a Code Cell

{% hint style="success" %}
*Check out the given walk-through on how to use a Code Cell under a Notebook.*
{% endhint %}

![Using a code cell under a Notebook](/files/Vm18gyhAZKr307j4JXBu)

You can write and execute code using the Notebook interface. This section covers the steps to write and run a sample code in the Code cell of the BDB DSL Notebook.

* Navigate to a Notebook.
* A cell to write and execute code opens under the selected Notebook.

![By default a Code gets added to a new Notebook ](/files/pKXdU5j3I7JVBkZUzLGg)

* Write code inside the cell.
* Click the ***Run cell*** icon to run the code.

![Write the code and run it](/files/PxWQp3vw0EtiBMSOFWxy)

* The Run cell button gets changed into the Interrupt cell icon while running the code.
* Another code cell gets added below (as shown in the following image).&#x20;

![While running the first cell one more cell gets added ](/files/szQr917t5FoamLPHO9vj)

* Once the code is run successfully a checkmark appears below the Run cell icon.
* The number before a cell indicates the count of the input executions for the notebook.

![When code gets run successfully](/files/s2Fx6Pf6ZD913XeM37Tp)

* Click the Save icon provided for the Notebook.
* The Notebook gets saved with the new update.
* A notification message appears to indicate the completion of the action.         &#x20;

![Saving the Notebook](/files/4nOMow1uQYy9yjtf8ke3)

{% hint style="info" %} <mark style="color:green;">Please Note:</mark>&#x20;

* *The **+Code** and **+Markdown** options provided at the bottom of a cell inserts a new cell after the given code/ Markdown cell.* &#x20;

&#x20;      ![](/files/nFYmQfuQL3KjB3UrPoML)   &#x20;

* *While the **Code** and **Markdown** options provided under the **Code** section of the Task Bar adds a new cell before the given code/Markdown cell.*

{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.bdb.ai/bdb-documentation/data-science-lab/various-tabs-to-work-with/notebook/notebook-page/notebook-cells/using-a-code-cell.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
