---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.11.5
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---
+++ {"deletable": false, "editable": false}
# Déplacer les cellules d'un carnet
Objectif pédagogique : Apprendre à déplacer les cellules
Comme vous avez pu le voir, dans ce [carnet](concept-ordre-d-execution.md), l'ordre d'execution des cellules est importante (voire priordiale) dans Jupyter.
+++ {"deletable": false, "editable": false}
## Exercice
Déplacez ou coupez / collez les cellules afin de les remettre dans le bon ordre pour pouvoir lancer l'execution complète du carnet en un clic avec .
Besoin d'un petit rappel sur le mode commande/edition et les raccourcis : cliquez [ici](concept-mode-edition-vs-commande.md)
```{code-cell} ipython3
---
deletable: True
editable: True
---
#Etape 2
def unarrondi(orientation,avancer):
if orientation == "L":
for i in range (0,45):
t.left(2)
t.forward(1)
else:
for i in range (0,45):
t.right(2)
t.forward(1)
if avancer=="V":
t.forward(60)
```
```{code-cell} ipython3
---
deletable: True
editable: True
---
#Etape 7
t.forward(15)
unarrondi("R","V")
unarrondi("R","F")
t.forward(70)
t.left(90)
t.forward(12)
t.left(90)
t.forward(45)
t.right(90)
t.forward(20)
unarrondi("R","V")
t.forward(2)
unarrondi("R","F")
t.forward(45)
unarrondi("R","V")
t.forward(10)
unarrondi("L","F")
t.forward(45)
```
```{code-cell} ipython3
---
deletable: True
editable: True
---
#Etape 3
t.penup()
t.left(90)
t.forward(90)
```
```{code-cell} ipython3
---
deletable: True
editable: True
---
#Etape 1
from mobilechelonian import Turtle
t = Turtle()
t.speed(20)
```
```{code-cell} ipython3
---
deletable: True
editable: True
---
#Etape 5
t.forward(45)
t.right(90)
t.forward(12)
t.right(90)
t.forward(70)
unarrondi("L","V")
unarrondi("L","F")
t.forward(15)
t.left(90)
t.forward(30)
unarrondi("R","V")
t.forward(10)
unarrondi("L","V")
```
```{code-cell} ipython3
---
deletable: True
editable: True
---
#Etape 6
t.penup()
t.right(180)
t.forward(20)
t.left(90)
t.forward(10)
t.pencolor("yellow")
t.pendown()
```
```{code-cell} ipython3
---
deletable: True
editable: True
---
#Etape 4
t.pendown()
t.forward(10)
t.pencolor("blue")
unarrondi("L","V")
unarrondi("L","F")
t.forward(20)
t.left(90)
```
+++ {"deletable": false, "editable": false}
## Conclusion
Pour savez maintenant déplacer les cellules pour facilement réorganiser vos programmes.
## Pour aller plus loin
* Découvrez comment utiliser [les différents types de cellules](tuto-les-types-de-cellules.md)
* Et aussi comment [Enrichir vos carnets avec des médias, liens et formules mathématiques](tuto-enrichir-text.md)