Bertrand Benjamin
518a03e5c1
All checks were successful
continuous-integration/drone/push Build is passing
86 lines
2.1 KiB
Plaintext
86 lines
2.1 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "78c29ed0",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Étape 5: boucle while\n",
|
|
"\n",
|
|
"`While` signifie `tant que` en anglais. Cette instruction va répéter **tant que** quelque chose est vrai."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "779f540b",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"i vaut 0 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 1 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 2 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 3 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 4 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 5 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 6 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 7 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 8 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 9 . C'est plus petit que 10 je continue\n",
|
|
"i vaut 10 . C'est plus grand que 10. Je suis sorti de la boucle\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"i = 0\n",
|
|
"while i < 10:\n",
|
|
" print(\"i vaut\", i, \". C'est plus petit que 10 je continue\")\n",
|
|
" i = i + 1\n",
|
|
"print(\"i vaut \", i, \". C'est plus grand que 10. Je suis sorti de la boucle\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "23aabfac",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "9ef8751b",
|
|
"metadata": {},
|
|
"source": [
|
|
"## - A trouvé?\n",
|
|
"\n",
|
|
"On veut programmer "
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.10.2"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|