diff --git a/Notebooks/06_Les_conditions.ipynb b/Notebooks/06_Les_conditions.ipynb index 3cff33fe65e91701033eabbbdb90e23a65a8382e..dba878fb2acbd548137108ef1f66b9c1b2d07f89 100644 --- a/Notebooks/06_Les_conditions.ipynb +++ b/Notebooks/06_Les_conditions.ipynb @@ -24,7 +24,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "# Variable x\nx = 3\nprint('x =', x)\n\n# 6 exemples de comparaisons\nprint('(x < 2) =', x < 2)\n\n\n\n\n" @@ -53,7 +53,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "x = 2 # affectation\nx == 2 # comparaison\n" @@ -72,7 +72,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "n = int(input('Entrez un nombre positif: '))\n\nif n > 0:\n print('Bravo !')" @@ -86,7 +86,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "n = int(input('Entrez un nombre: '))\n\nif n > 0:\n print('positif')\nelse:\n print('négatif')" @@ -100,7 +100,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "n = int(input('Entrez un nombre: '))\n\nif n > 0:\n print('positif')\nelif n < 0:\n print('négatif')\nelse:\n print('zéro')\n" @@ -114,7 +114,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "# !!! Exemple à éviter !!!!\nn = int(input('Entrez un nombre: '))\n\nif n > 0:\n print('positif')\nelse:\n if n < 0:\n print('négatif')\n else:\n print('zéro')\n" @@ -143,7 +143,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "age = int(input(\"Bonjour, quel est votre âge ?\"))\n\n" @@ -157,7 +157,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "from turtle import *\n\n\n\n\n\ndone()" @@ -176,7 +176,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "def temperature(t):\n ...\n \n \n \n \ntemp = int(input(\"Entrez une température entre -20 et 50 : \"))\ntemperature(temp)" @@ -195,7 +195,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "\n\n\n" @@ -209,7 +209,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "nombre = 15\nif nombre > 10 and nombre < 20:\n print(\"Le nombre est entre 10 et 20.\")\n \n\nif nombre == 5 or nombre == 15:\n print(\"Le nombre est soit 15 soit 20.\")\n \nif not nombre > 15:\n print(\"Le nombre n'est pas supérieur à 15.\")" @@ -233,7 +233,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "" @@ -247,7 +247,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "" @@ -262,6 +262,15 @@ "metadata": {}, "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 8 </h3> \n\n<b style=\"color:chocolate;background-color:papayawhip;\" > <i class=\"fa fa-warning\" aria-hidden=\"true\"> </i> Rappel : L'opérateur modulo (%) calcule le reste de la division entière. En conséquence, x % y vaut 0 quand x est divisible par y. <i class=\"fa fa-warning\" aria-hidden=\"true\"> </i> </b> \n\n\nÉcrivez un petit programme qui demande à l'utilisateur·ice un nombre et indique s'il est pair (divisible par 2) ou pas.\n" }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": true + }, + "outputs": [], + "source": "" + }, { "cell_type": "markdown", "metadata": {}, @@ -271,7 +280,7 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "age == 18\nrevenu == 25000\n\nif age >= 18\nif revenu < 25000\nprint(\"Vous êtes éligible à la subvention.\")\nelif revenu < 26000\nprint(\"Vous êtes presque éligible à la subvention, vous gagnez 1'000.- de trop.\")\nelse:\nprint(\"Vous n'êtes pas éligible à cause de vos revenus trop élevés.\")\nelse:\nif revenu < 25000\nprint(\"Vous n'êtes pas éligible à cause de votre âge, mais le seriez si vous étiez majeur·e.\")\nelse:\nprint(\"Vous n'êtes pas éligible à cause de vos revenus trop élevés et de votre âge.\")\n \n" @@ -284,13 +293,13 @@ { "cell_type": "markdown", "metadata": {}, - "source": "Écris une fonction bissextile dont l'argument est une année n, qui dit si cette année est bissextile (c'est-à-dire qu'elle comporte un 29 février).\nUne année est bissextile dans l'un des cas suivants :\n- c'est un multiple de 4 qui n'est pas un multiple de 100,\n- c'est un multiple de 400.\n\nLe programme doit renvoyer « Année bissextile » ou « Année non bissextile » suivant le cas. " + "source": "Écris une fonction bissextile dont l'argument est une année n, qui dit si cette année est bissextile (c'est-à-dire qu'elle comporte un 29 février).\nUne année est bissextile dans l'un des cas suivants :\n- c'est un multiple de 4 qui n'est pas un multiple de 100,\n- c'est un multiple de 400.\n\nLe programme doit afficher « Année bissextile » ou « Année non bissextile » suivant le cas. " }, { "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], "source": "" @@ -304,10 +313,10 @@ "cell_type": "code", "execution_count": null, "metadata": { - "trusted": true + "trusted": false }, "outputs": [], - "source": "print('Quiz sur le thème : ....')\n\nscore = 0\n\n# Question 1 \nprint()\nquestion = \"Quel est le nom du cowboy dans Toy Story ?\"\nreponse = 'Woody'\n\nreponse = input(question)\nif reponse == solution:\n ...\nelse:\n ...\n \n \n\n# Question 2\nprint()\n...\n\n\nprint('Votre score est', ...)" + "source": "print('Quiz sur le thème : ....')\n\nscore = 0\n\n# Question 1 \nprint()\nquestion = \"Quel est le nom du cowboy dans Toy Story ?\"\nsolution = 'Woody'\n\nreponse = input(question)\nif reponse == solution:\n ...\nelse:\n ...\n \n \n\n# Question 2\nprint()\n...\n\n\nprint('Votre score est', ...)" }, { "cell_type": "markdown", diff --git a/Notebooks/06_Les_conditions_correction.ipynb b/Notebooks/06_Les_conditions_correction.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..856ee73dede9d552ad2d711bde5da1a3f6dd4079 --- /dev/null +++ b/Notebooks/06_Les_conditions_correction.ipynb @@ -0,0 +1,405 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": "<div style=\"padding:20px;background-color:papayawhip;\" > \n<h3 style=\"color:chocolate\"> <i class=\"fa fa-info\" aria-hidden=\"true\"> </i> Remarque introductive <i class=\"fa fa-info\" aria-hidden=\"true\"></h3> \n<p> Ce fichier est fait pour être lu sur le site <a href=\"https://notebook.basthon.fr/\"><img src='https://notebook.basthon.fr/assets/efede5218c9087496f16.png' style=\"border: 0; display:inline; margin: 0 5px; height:30px\" alt=\"Basthon\"/></a>. <br>\n \nSi vous l'avez ouvert avec un autre programme, comme Jupyter notebook, vous riquez de rencontrer quelques bugs. <br>\nVeuillez cliquez sur <a href=\"https://notebook.basthon.fr/\">ce lien</a> et y charger ce fichier à l'aide du bouton \"Ouvrir\" <i class=\"fa fa-folder\" aria-hidden=\"true\"> </i>\n</p> </div> " + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "# Les Conditions\n\nDans ce chapitre, nous allons voir comment un programme peut faire des choix, et comment il peut exécuter du code de façon sélective.\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "## I) Comparaisons\n\nUn programme doit parfois comparer deux valeurs.\nPython connait six types de comparaisons :\n\n- plus petit (`<`),\n- plus petit ou égal (`<=`),\n- égal (`==`),\n- différent (`!=`),\n- plus grand (`>`),\n- plus grand ou égal (`>=`).\n\nDans des formules mathématiques nous utilisons les symboles ≤, ≥ et ≠. En Python vous devez utiliser deux symboles: `<=`, `>=` et `!=` à la place.\n\nLe résultat d'une comparaison est une valeur booléenne, soit `True` soit `False`.\n\n\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 1 </h3>Testez les lignes ci-dessous et ajoutez des exemples avec les autres 5 comparateurs.\n\n" + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "x = 3\n(x < 2) = False\n(x > 2) = True\n(x == 2) = False\n(x <= 2) = False\n(x >= 2) = True\n" + } + ], + "source": "# Variable x\nx = 3\nprint('x =', x)\n\n# 6 exemples de comparaisons\nprint('(x < 2) =', x < 2)\nprint('(x > 2) =', x > 2)\nprint('(x == 2) =', x == 2)\nprint('(x <= 2) =', x <= 2)\nprint('(x >= 2) =', x >= 2)\n\n\n\n\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:chocolate;background-color:papayawhip;\" > <i class=\"fa fa-question\" aria-hidden=\"true\"> </i> Quizz </h3> \n \n```\nL'expression `x == 2`\n\nA) met la valeur 2 dans la variable x\nB) compare deux valeurs\nC) affecte la variable x avec une valeur\nD) retourne True ou False\n```" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<details>\n<summary style=\"border-left:3px solid #3c763d; border-radius:2pt; width:100%; color:#3c763d; padding:6px; background-color: #dff0d8\"> \nRéponse\n</summary> \n\n<div style=\"border-left:3px solid #3c763d; border-radius:2pt; color:#3c763d; padding:6px; background-color: #eff0e8\">D) retourne True ou False\n</div>\n</details>\n " + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "\n\n```{caution}\n!! Il ne faut pas confondre l'opérateur d'affectation (`x = 2`) avec l'opérateur de comparaison (`x == 2`) !!\n```\n\n<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 2 </h3>Que se passe-t-il si vous échangez les deux éléments dans `x == 2` ? \nEt si vous échangez les deux éléments dans `x = 2` ?\n\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": false + }, + "outputs": [], + "source": "x = 2 # affectation\nx == 2 # comparaison\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "## II) Conditions (`if`)\n\nAfin d'exécuter du code de façon sélective, on utilise le mot-clé `if`.\n\nNous allons voir que :\n\n- le mot-clé `if` permet une exécution conditionnelle,\n- le mot-clé `if-else` permet de choisir entre deux alternatives,\n- le mot-clé `elif` (else if) permet d'ajouter différentes conditions.\n\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "### Exécution conditionnelle `if`\n\nLa structure `if` ci-dessous permet d'exécuter une action seulement si `condition` est `True`.\n\n``` python\nif condition:\n action\n```\n\nDans notre exemple nous affichons \"Bravo!\" si la valeur entrée est positive.\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": false + }, + "outputs": [], + "source": "n = int(input('Entrez un nombre positif: '))\n\nif n > 0:\n print('Bravo !')" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "### Choix binaire `if - else`\n\nLa structure `if - else` ci-dessous permet d'exécuter une **action_1** seulement si une **condition** est vraie et une **action_2** sinon : \n\n``` python\nif condition:\n action_1\nelse:\n action_2\n```\n\nDans l'exemple ci-dessous, on affiche si un nombre entré est positif ou négatif :\n\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": false + }, + "outputs": [], + "source": "n = int(input('Entrez un nombre: '))\n\nif n > 0:\n print('positif')\nelse:\n print('négatif')" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "### Choix multiple (`if - elif - else`)\n\nLe mot-clé `elif` est une contraction de **else if** et permet de continuer à tester d'autres conditions : \n\n``` python\nif condition1 :\n action_1\nelif condition2 :\n action_2\nelse:\n action_3\n```\n\nDans l'exemple ci-dessous, on affiche si un nombre entré est positif, négatif ou nul :\n\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": false + }, + "outputs": [], + "source": "n = int(input('Entrez un nombre: '))\n\nif n > 0:\n print('positif')\nelif n < 0:\n print('négatif')\nelse:\n print('zéro')\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Sans le mot-clé `elif` nous devrions mettre le bloc `if` à l'intérieur du bloc `else` en indentation.\nAvec multiples conditions, les blocs se décalent de plus en plus et rendent le programme illisible, comme ci-dessous.\n\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": false + }, + "outputs": [], + "source": "# !!! Exemple à éviter !!!!\nn = int(input('Entrez un nombre: '))\n\nif n > 0:\n print('positif')\nelse:\n if n < 0:\n print('négatif')\n else:\n print('zéro')\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:chocolate;background-color:papayawhip;\" > <i class=\"fa fa-question\" aria-hidden=\"true\"> </i> Quizz </h3> \n \n```\nEn Python, `if` est suivi\n\nA) d'un bloc\nB) d'une condition\nC) de parenthèses\nD) d'un deux-points\n```" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<details>\n<summary style=\"border-left:3px solid #3c763d; border-radius:2pt; width:100%; color:#3c763d; padding:6px; background-color: #dff0d8\"> \nRéponse\n</summary> \n\n<div style=\"border-left:3px solid #3c763d; border-radius:2pt; color:#3c763d; padding:6px; background-color: #eff0e8\">B) d'une condition (Et ensuite de D), un deux-points)\n</div>\n</details>\n \n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 3 </h3>Écrivez un petit programme qui demande son âge à l'utilisatrice et affiche si elle est mineure ou majeure.\n\nRappel : la fonction `int` transforme la réponse textuelle du `input` en nombre entier.\n\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": false + }, + "outputs": [], + "source": "age = int(input(\"Bonjour, quel est votre âge ?\"))\n\nif age >= 18:\n print(\"Vous êtes majeure.\")\nelse :\n print(\"Vous êtes mineure.\")" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 4 </h3>Écrivez un petit programme qui demande à l'utilisateur·ice s'il faut dessiner un triangle, un cercle ou un carré, puis qui fait le bon dessin.\n\n" + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "Voulez-vous un triangle, un carré ou un cercle ?cercle\n" + }, + { + "data": { + "image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"640\" height=\"480\" preserveaspectratio=\"xMidYMid meet\" viewbox=\"0 0 640 480\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_0\" attributename=\"opacity\" attributetype=\"CSS\" from=\"1\" to=\"1\" begin=\"0s\" dur=\"1ms\" fill=\"freeze\"></animate><g transform=\"translate(320 240)\"></g><g transform=\"translate(320 240)\"><line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"0\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_2\" attributename=\"x2\" attributetype=\"XML\" from=\"0\" to=\"0\" dur=\"1ms\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_1.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_1.end\" from=\"0\" to=\"0\" dur=\"1ms\" fill=\"freeze\"></animate></line><line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"0\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_6\" attributename=\"x2\" attributetype=\"XML\" from=\"0\" to=\"22.25209339563144\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_5.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_5.end\" from=\"0\" to=\"-2.5072087818176394\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"22.25209339563144\" y1=\"-2.5072087818176394\" x2=\"22.25209339563144\" y2=\"-2.5072087818176394\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_8\" attributename=\"x2\" attributetype=\"XML\" from=\"22.25209339563144\" to=\"43.388373911755814\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_7.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_7.end\" from=\"-2.5072087818176394\" to=\"-9.903113209758086\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"43.388373911755814\" y1=\"-9.903113209758086\" x2=\"43.388373911755814\" y2=\"-9.903113209758086\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_10\" attributename=\"x2\" attributetype=\"XML\" from=\"43.388373911755814\" to=\"62.34898018587336\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_9.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_9.end\" from=\"-9.903113209758086\" to=\"-21.816851753197014\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"62.34898018587336\" y1=\"-21.816851753197014\" x2=\"62.34898018587336\" y2=\"-21.816851753197014\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_12\" attributename=\"x2\" attributetype=\"XML\" from=\"62.34898018587336\" to=\"78.18314824680299\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_11.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_11.end\" from=\"-21.816851753197014\" to=\"-37.65101981412664\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"78.18314824680299\" y1=\"-37.65101981412664\" x2=\"78.18314824680299\" y2=\"-37.65101981412664\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_14\" attributename=\"x2\" attributetype=\"XML\" from=\"78.18314824680299\" to=\"90.09688679024191\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_13.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_13.end\" from=\"-37.65101981412664\" to=\"-56.61162608824418\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"90.09688679024191\" y1=\"-56.61162608824418\" x2=\"90.09688679024191\" y2=\"-56.61162608824418\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_16\" attributename=\"x2\" attributetype=\"XML\" from=\"90.09688679024191\" to=\"97.49279121818236\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_15.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_15.end\" from=\"-56.61162608824418\" to=\"-77.74790660436855\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"97.49279121818236\" y1=\"-77.74790660436855\" x2=\"97.49279121818236\" y2=\"-77.74790660436855\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_18\" attributename=\"x2\" attributetype=\"XML\" from=\"97.49279121818236\" to=\"100\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_17.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_17.end\" from=\"-77.74790660436855\" to=\"-100\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"100\" y1=\"-100\" x2=\"100\" y2=\"-100\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_20\" attributename=\"x2\" attributetype=\"XML\" from=\"100\" to=\"97.49279121818236\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_19.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_19.end\" from=\"-100\" to=\"-122.25209339563145\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"97.49279121818236\" y1=\"-122.25209339563145\" x2=\"97.49279121818236\" y2=\"-122.25209339563145\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_22\" attributename=\"x2\" attributetype=\"XML\" from=\"97.49279121818236\" to=\"90.09688679024191\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_21.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_21.end\" from=\"-122.25209339563145\" to=\"-143.38837391175582\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"90.09688679024191\" y1=\"-143.38837391175582\" x2=\"90.09688679024191\" y2=\"-143.38837391175582\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_24\" attributename=\"x2\" attributetype=\"XML\" from=\"90.09688679024191\" to=\"78.18314824680297\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_23.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_23.end\" from=\"-143.38837391175582\" to=\"-162.34898018587336\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"78.18314824680297\" y1=\"-162.34898018587336\" x2=\"78.18314824680297\" y2=\"-162.34898018587336\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_26\" attributename=\"x2\" attributetype=\"XML\" from=\"78.18314824680297\" to=\"62.34898018587334\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_25.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_25.end\" from=\"-162.34898018587336\" to=\"-178.18314824680297\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"62.34898018587334\" y1=\"-178.18314824680297\" x2=\"62.34898018587334\" y2=\"-178.18314824680297\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_28\" attributename=\"x2\" attributetype=\"XML\" from=\"62.34898018587334\" to=\"43.38837391175579\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_27.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_27.end\" from=\"-178.18314824680297\" to=\"-190.0968867902419\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"43.38837391175579\" y1=\"-190.0968867902419\" x2=\"43.38837391175579\" y2=\"-190.0968867902419\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_30\" attributename=\"x2\" attributetype=\"XML\" from=\"43.38837391175579\" to=\"22.252093395631416\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_29.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_29.end\" from=\"-190.0968867902419\" to=\"-197.49279121818233\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"22.252093395631416\" y1=\"-197.49279121818233\" x2=\"22.252093395631416\" y2=\"-197.49279121818233\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_32\" attributename=\"x2\" attributetype=\"XML\" from=\"22.252093395631416\" to=\"-2.842170943040401e-14\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_31.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_31.end\" from=\"-197.49279121818233\" to=\"-199.99999999999994\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-2.842170943040401e-14\" y1=\"-199.99999999999994\" x2=\"-2.842170943040401e-14\" y2=\"-199.99999999999994\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_34\" attributename=\"x2\" attributetype=\"XML\" from=\"-2.842170943040401e-14\" to=\"-22.252093395631466\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_33.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_33.end\" from=\"-199.99999999999994\" to=\"-197.49279121818228\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-22.252093395631466\" y1=\"-197.49279121818228\" x2=\"-22.252093395631466\" y2=\"-197.49279121818228\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_36\" attributename=\"x2\" attributetype=\"XML\" from=\"-22.252093395631466\" to=\"-43.388373911755835\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_35.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_35.end\" from=\"-197.49279121818228\" to=\"-190.09688679024183\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-43.388373911755835\" y1=\"-190.09688679024183\" x2=\"-43.388373911755835\" y2=\"-190.09688679024183\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_38\" attributename=\"x2\" attributetype=\"XML\" from=\"-43.388373911755835\" to=\"-62.34898018587337\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_37.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_37.end\" from=\"-190.09688679024183\" to=\"-178.1831482468029\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-62.34898018587337\" y1=\"-178.1831482468029\" x2=\"-62.34898018587337\" y2=\"-178.1831482468029\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_40\" attributename=\"x2\" attributetype=\"XML\" from=\"-62.34898018587337\" to=\"-78.18314824680299\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_39.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_39.end\" from=\"-178.1831482468029\" to=\"-162.34898018587324\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-78.18314824680299\" y1=\"-162.34898018587324\" x2=\"-78.18314824680299\" y2=\"-162.34898018587324\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_42\" attributename=\"x2\" attributetype=\"XML\" from=\"-78.18314824680299\" to=\"-90.09688679024191\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_41.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_41.end\" from=\"-162.34898018587324\" to=\"-143.3883739117557\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-90.09688679024191\" y1=\"-143.3883739117557\" x2=\"-90.09688679024191\" y2=\"-143.3883739117557\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_44\" attributename=\"x2\" attributetype=\"XML\" from=\"-90.09688679024191\" to=\"-97.49279121818235\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_43.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_43.end\" from=\"-143.3883739117557\" to=\"-122.25209339563133\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-97.49279121818235\" y1=\"-122.25209339563133\" x2=\"-97.49279121818235\" y2=\"-122.25209339563133\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_46\" attributename=\"x2\" attributetype=\"XML\" from=\"-97.49279121818235\" to=\"-99.99999999999997\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_45.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_45.end\" from=\"-122.25209339563133\" to=\"-99.99999999999989\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-99.99999999999997\" y1=\"-99.99999999999989\" x2=\"-99.99999999999997\" y2=\"-99.99999999999989\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_48\" attributename=\"x2\" attributetype=\"XML\" from=\"-99.99999999999997\" to=\"-97.49279121818233\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_47.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_47.end\" from=\"-99.99999999999989\" to=\"-77.74790660436844\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-97.49279121818233\" y1=\"-77.74790660436844\" x2=\"-97.49279121818233\" y2=\"-77.74790660436844\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_50\" attributename=\"x2\" attributetype=\"XML\" from=\"-97.49279121818233\" to=\"-90.09688679024188\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_49.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_49.end\" from=\"-77.74790660436844\" to=\"-56.611626088244066\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-90.09688679024188\" y1=\"-56.611626088244066\" x2=\"-90.09688679024188\" y2=\"-56.611626088244066\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_52\" attributename=\"x2\" attributetype=\"XML\" from=\"-90.09688679024188\" to=\"-78.18314824680297\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_51.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_51.end\" from=\"-56.611626088244066\" to=\"-37.65101981412651\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-78.18314824680297\" y1=\"-37.65101981412651\" x2=\"-78.18314824680297\" y2=\"-37.65101981412651\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_54\" attributename=\"x2\" attributetype=\"XML\" from=\"-78.18314824680297\" to=\"-62.34898018587336\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_53.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_53.end\" from=\"-37.65101981412651\" to=\"-21.816851753196865\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-62.34898018587336\" y1=\"-21.816851753196865\" x2=\"-62.34898018587336\" y2=\"-21.816851753196865\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_56\" attributename=\"x2\" attributetype=\"XML\" from=\"-62.34898018587336\" to=\"-43.388373911755835\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_55.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_55.end\" from=\"-21.816851753196865\" to=\"-9.903113209757914\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-43.388373911755835\" y1=\"-9.903113209757914\" x2=\"-43.388373911755835\" y2=\"-9.903113209757914\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_58\" attributename=\"x2\" attributetype=\"XML\" from=\"-43.388373911755835\" to=\"-22.252093395631476\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_57.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_57.end\" from=\"-9.903113209757914\" to=\"-2.5072087818174227\" dur=\" 0.120s\" fill=\"freeze\"></animate></line><line x1=\"-22.252093395631476\" y1=\"-2.5072087818174227\" x2=\"-22.252093395631476\" y2=\"-2.5072087818174227\" style=\"stroke: black;stroke-width: 1\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_60\" attributename=\"x2\" attributetype=\"XML\" from=\"-22.252093395631476\" to=\"-3.907985046680551e-14\" dur=\" 0.120s\" fill=\"freeze\" begin=\"af_cc3e238b7507499094c192ff5e582561_59.end\"></animate><animate attributename=\"y2\" attributetype=\"XML\" begin=\"af_cc3e238b7507499094c192ff5e582561_59.end\" from=\"-2.5072087818174227\" to=\"2.615685446016869e-13\" dur=\" 0.120s\" fill=\"freeze\"></animate></line></g><g transform=\"translate(320 240)\"></g><g transform=\"translate(320 240)\"><polygon points=\"0,16 -2,14 -1,10 -4,7 -7,9 -9,8 -6,5 -7,1 -5,-3 -8,-6 -6,-8 -4,-5 0,-7 4,-5 6,-8 8,-6 5,-3 7,1 6,5 9,8 7,9 4,7 1,10 2,14\" stroke=\"black\" fill=\"black\" stroke-width=\"1\" opacity=\"0\"><animate id=\"af_cc3e238b7507499094c192ff5e582561_1\" begin=\"af_cc3e238b7507499094c192ff5e582561_0.end\" dur=\"1ms\" fill=\"freeze\" attributename=\"opacity\" attributetype=\"XML\" from=\"0\" to=\"1\"></animate><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_2.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_3\" type=\"rotate\" from=\"0,0,0\" to=\"0.0,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_2.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_3.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_4\" type=\"rotate\" from=\"-90.0,0,0\" to=\"-90.0,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_3.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_4.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_5\" type=\"rotate\" from=\"-90.0,0,0\" to=\"-96.42857142857143,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_4.end\" dur=\" 0.006s\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_5.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"0.0,-0.0\" to=\"22.25209339563144,-2.5072087818176394\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_5.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_6.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_7\" type=\"rotate\" from=\"-96.42857142857143,0,0\" to=\"-109.28571428571429,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_6.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_7.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"22.25209339563144,-2.5072087818176394\" to=\"43.388373911755814,-9.903113209758086\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_7.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_8.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_9\" type=\"rotate\" from=\"-109.28571428571429,0,0\" to=\"-122.14285714285715,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_8.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_9.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"43.388373911755814,-9.903113209758086\" to=\"62.34898018587336,-21.816851753197014\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_9.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_10.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_11\" type=\"rotate\" from=\"-122.14285714285715,0,0\" to=\"-135.0,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_10.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_11.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"62.34898018587336,-21.816851753197014\" to=\"78.18314824680299,-37.65101981412664\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_11.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_12.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_13\" type=\"rotate\" from=\"-135.0,0,0\" to=\"-147.85714285714286,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_12.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_13.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"78.18314824680299,-37.65101981412664\" to=\"90.09688679024191,-56.61162608824418\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_13.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_14.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_15\" type=\"rotate\" from=\"-147.85714285714286,0,0\" to=\"-160.71428571428572,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_14.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_15.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"90.09688679024191,-56.61162608824418\" to=\"97.49279121818236,-77.74790660436855\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_15.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_16.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_17\" type=\"rotate\" from=\"-160.71428571428572,0,0\" to=\"-173.57142857142858,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_16.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_17.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"97.49279121818236,-77.74790660436855\" to=\"100.0,-100.0\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_17.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_18.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_19\" type=\"rotate\" from=\"-173.57142857142858,0,0\" to=\"-186.42857142857144,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_18.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_19.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"100.0,-100.0\" to=\"97.49279121818236,-122.25209339563145\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_19.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_20.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_21\" type=\"rotate\" from=\"-186.42857142857144,0,0\" to=\"-199.2857142857143,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_20.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_21.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"97.49279121818236,-122.25209339563145\" to=\"90.09688679024191,-143.38837391175582\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_21.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_22.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_23\" type=\"rotate\" from=\"-199.2857142857143,0,0\" to=\"-212.14285714285717,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_22.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_23.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"90.09688679024191,-143.38837391175582\" to=\"78.18314824680297,-162.34898018587336\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_23.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_24.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_25\" type=\"rotate\" from=\"-212.14285714285717,0,0\" to=\"-225.00000000000003,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_24.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_25.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"78.18314824680297,-162.34898018587336\" to=\"62.34898018587334,-178.18314824680297\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_25.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_26.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_27\" type=\"rotate\" from=\"-225.00000000000003,0,0\" to=\"-237.8571428571429,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_26.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_27.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"62.34898018587334,-178.18314824680297\" to=\"43.38837391175579,-190.0968867902419\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_27.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_28.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_29\" type=\"rotate\" from=\"-237.8571428571429,0,0\" to=\"-250.71428571428575,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_28.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_29.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"43.38837391175579,-190.0968867902419\" to=\"22.252093395631416,-197.49279121818233\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_29.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_30.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_31\" type=\"rotate\" from=\"-250.71428571428575,0,0\" to=\"-263.5714285714286,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_30.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_31.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"22.252093395631416,-197.49279121818233\" to=\"-2.842170943040401e-14,-199.99999999999994\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_31.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_32.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_33\" type=\"rotate\" from=\"-263.5714285714286,0,0\" to=\"-276.42857142857144,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_32.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_33.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-2.842170943040401e-14,-199.99999999999994\" to=\"-22.252093395631466,-197.49279121818228\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_33.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_34.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_35\" type=\"rotate\" from=\"-276.42857142857144,0,0\" to=\"-289.2857142857143,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_34.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_35.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-22.252093395631466,-197.49279121818228\" to=\"-43.388373911755835,-190.09688679024183\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_35.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_36.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_37\" type=\"rotate\" from=\"-289.2857142857143,0,0\" to=\"-302.1428571428571,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_36.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_37.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-43.388373911755835,-190.09688679024183\" to=\"-62.34898018587337,-178.1831482468029\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_37.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_38.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_39\" type=\"rotate\" from=\"-302.1428571428571,0,0\" to=\"-314.99999999999994,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_38.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_39.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-62.34898018587337,-178.1831482468029\" to=\"-78.18314824680299,-162.34898018587324\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_39.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_40.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_41\" type=\"rotate\" from=\"-314.99999999999994,0,0\" to=\"-327.8571428571428,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_40.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_41.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-78.18314824680299,-162.34898018587324\" to=\"-90.09688679024191,-143.3883739117557\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_41.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_42.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_43\" type=\"rotate\" from=\"-327.8571428571428,0,0\" to=\"-340.7142857142856,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_42.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_43.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-90.09688679024191,-143.3883739117557\" to=\"-97.49279121818235,-122.25209339563133\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_43.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_44.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_45\" type=\"rotate\" from=\"-340.7142857142856,0,0\" to=\"-353.57142857142844,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_44.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_45.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-97.49279121818235,-122.25209339563133\" to=\"-99.99999999999997,-99.99999999999989\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_45.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_46.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_47\" type=\"rotate\" from=\"-353.57142857142844,0,0\" to=\"-366.4285714285713,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_46.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_47.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-99.99999999999997,-99.99999999999989\" to=\"-97.49279121818233,-77.74790660436844\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_47.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_48.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_49\" type=\"rotate\" from=\"-366.4285714285713,0,0\" to=\"-379.2857142857141,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_48.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_49.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-97.49279121818233,-77.74790660436844\" to=\"-90.09688679024188,-56.611626088244066\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_49.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_50.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_51\" type=\"rotate\" from=\"-379.2857142857141,0,0\" to=\"-392.14285714285694,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_50.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_51.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-90.09688679024188,-56.611626088244066\" to=\"-78.18314824680297,-37.65101981412651\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_51.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_52.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_53\" type=\"rotate\" from=\"-392.14285714285694,0,0\" to=\"-404.9999999999998,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_52.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_53.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-78.18314824680297,-37.65101981412651\" to=\"-62.34898018587336,-21.816851753196865\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_53.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_54.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_55\" type=\"rotate\" from=\"-404.9999999999998,0,0\" to=\"-417.8571428571426,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_54.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_55.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-62.34898018587336,-21.816851753196865\" to=\"-43.388373911755835,-9.903113209757914\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_55.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_56.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_57\" type=\"rotate\" from=\"-417.8571428571426,0,0\" to=\"-430.71428571428544,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_56.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_57.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-43.388373911755835,-9.903113209757914\" to=\"-22.252093395631476,-2.5072087818174227\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_57.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_58.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_59\" type=\"rotate\" from=\"-430.71428571428544,0,0\" to=\"-443.57142857142827,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_58.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_59.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateMotion from=\"-22.252093395631476,-2.5072087818174227\" to=\"-3.907985046680551e-14,2.615685446016869e-13\" dur=\" 0.120s\" begin=\"af_cc3e238b7507499094c192ff5e582561_59.end\" fill=\"freeze\"></animateMotion><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_60.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_61\" type=\"rotate\" from=\"-443.57142857142827,0,0\" to=\"-456.4285714285711,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_60.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform><animateMotion begin=\"af_cc3e238b7507499094c192ff5e582561_61.end\" dur=\"1ms\" fill=\"remove\"></animateMotion><animateTransform attributename=\"transform\" id=\"af_cc3e238b7507499094c192ff5e582561_62\" type=\"rotate\" from=\"-456.4285714285711,0,0\" to=\"-449.99999999999966,0,0\" begin=\"af_cc3e238b7507499094c192ff5e582561_61.end\" dur=\"1ms\" fill=\"freeze\"></animateTransform></polygon></g></svg>" + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": "from turtle import *\n\nforme = input(\"Voulez-vous un triangle, un carré ou un cercle ?\")\n\nif forme == \"triangle\":\n for _ in range(3):\n forward(100)\n right(120)\nelif forme == \"carré\":\n for _ in range(4):\n forward(100)\n right(90)\nelif forme == \"cercle\":\n circle(100)\nelse :\n print(\"Forme inconnue...\")\n\n\n\ndone()" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 5 </h3> \n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Définissez une fonction `temperature()` qui prend en paramètre une température entre -20 et 50 et affiche si cette température est :\n* glaciale\n* froide\n* normale\n* chaude\n* bouillante\n\n(à vous de choisir les bornes de chaque catégorie)\n" + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "Entrez une température entre -20 et 50 : 0\nfroide\n" + } + ], + "source": "def temperature(t):\n if t <-5 : \n print(\"glaciale\")\n elif t <10 : \n print(\"froide\")\n elif t <20 : \n print(\"normale\")\n elif t <40 : \n print(\"chaude\")\n else : \n print(\"bouillante\")\n \n \n \n \ntemp = int(input(\"Entrez une température entre -20 et 50 : \"))\ntemperature(temp)" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 6 </h3> " + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Définissez une fonction `compare` qui prend en paramètres deux nombres `a` et `b`, puis qui dit lequel est le plus grand :\n- si le premier nombre est plus grand que le deuxième, le programme affichera « Le premier ! »\n- si le deuxième nombre est plus grand que le premier, le programme affichera « Le deuxième ! »\n- s'ils sont égaux, le programme affichera « Ils sont égaux. ».\n\n\nTestez-la avec deux nombres de votre choix." + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": " Le premier !\n" + } + ], + "source": "def compare(a,b):\n if a > b :\n print(\" Le premier !\")\n elif b < a :\n print(\"Le deuxième !\")\n else : \n print(\"Ils sont égaux.\")\n \ncompare (100, 12)\n \n\n\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "## Les opérateurs `and`, `or` et `not`\n\nEn plus des comparateurs, les opérateurs `and`, `or` et `not` permettent de manipuler plusieurs conditions : \n* `X and Y` Les deux conditions doivent être vraies pour que l'expression soit vraie.\n* `X or Y` Une des deux conditions doit être vraies pour que l'expression soit vraie.\n* `not X` La condition X doit être fausse pour que l'expression soit vraie.\n\nTestez le code suivant : \n\n" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "trusted": false + }, + "outputs": [], + "source": "nombre = 15\nif nombre > 10 and nombre < 20:\n print(\"Le nombre est entre 10 et 20.\")\n \n\nif nombre == 5 or nombre == 15:\n print(\"Le nombre est soit 15 soit 20.\")\n \nif not nombre > 15:\n print(\"Le nombre n'est pas supérieur à 15.\")" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h6 style=\"color:chocolate;background-color:papayawhip;\" > <i class=\"fa fa-warning\" aria-hidden=\"true\"> </i> Note </h6>\nEn python, pour le premier cas : \n\n``` python\nif nombre > 10 and nombre < 20:\n print(\"Le nombre est entre 10 et 20.\")\n```\non peut aussi écrire :\n\n``` python\nif 10 < nombre < 20:\n print(\"Le nombre est entre 10 et 20.\")\n```" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 7 </h3>\n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Écrire un code qui traduit chacune des situations ci-après. Chaque programme commence par créer une variable pour chaque âge.\n\n**Situation 1 :** Si Camille est plus âgée qu’Antoinette ou que Bernard et si Antoinette est plus jeune que Bernard, on affiche l’âge d’Antoinette, mais si Antoinette a le même âge ou est plus âgée que Bernard, on affiche l’âge de Bernard.\nSinon on affiche l’âge de Camille.\n\n \n" + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "10\n" + } + ], + "source": "camille = 42\nbernard = 10\nantoinette = 15\n\nif (camille > antoinette or camille > bernard) and (antoinette < bernard):\n print(antoinette)\nelif antoinette >= bernard :\n print(bernard)\nelse:\n print(camille)" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "**Situation 2:** Si Bernard et Camille ont le même âge, on affiche l’âge de la plus jeune des trois personnes." + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "15\n" + } + ], + "source": "camille = 42\nbernard = 42\nantoinette = 15\n\nif camille == bernard:\n if antoinette < camille:\n print(antoinette)\n else :\n print(camille)" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "## Exercices récapitulatifs" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 8 </h3> \n\n<b style=\"color:chocolate;background-color:papayawhip;\" > <i class=\"fa fa-warning\" aria-hidden=\"true\"> </i> Rappel : L'opérateur modulo (%) calcule le reste de la division entière. En conséquence, x % y vaut 0 quand x est divisible par y. <i class=\"fa fa-warning\" aria-hidden=\"true\"> </i> </b> \n\n\nÉcrivez un petit programme qui demande à l'utilisateur·ice un nombre et indique s'il est pair (divisible par 2) ou pas.\n" + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "Entrez un nombre : 12\n12 est pair.\n" + } + ], + "source": "nombre = int(input(\"Entrez un nombre : \"))\n\nif nombre % 2 == 0 :\n print(nombre,\"est pair.\")\nelse:\n print(nombre,\"est impair.\")" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 9 </h3>\nCorrigez le code suivant :" + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "Vous êtes presque éligible à la subvention, vous gagnez 1'000.- de trop.\n" + } + ], + "source": "age = 18\nrevenu = 25000\n\nif age >= 18:\n if revenu < 25000:\n print(\"Vous êtes éligible à la subvention.\")\n elif revenu < 26000:\n print(\"Vous êtes presque éligible à la subvention, vous gagnez 1'000.- de trop.\")\n else:\n print(\"Vous n'êtes pas éligible à cause de vos revenus trop élevés.\")\nelse:\n if revenu < 25000:\n print(\"Vous n'êtes pas éligible à cause de votre âge, mais le seriez si vous étiez majeur·e.\")\n else:\n print(\"Vous n'êtes pas éligible à cause de vos revenus trop élevés et de votre âge.\")\n \n" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 10 </h3>" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "Écris une fonction bissextile dont l'argument est une année n, qui dit si cette année est bissextile (c'est-à-dire qu'elle comporte un 29 février).\nUne année est bissextile dans l'un des cas suivants :\n- c'est un multiple de 4 qui n'est pas un multiple de 100,\n- c'est un multiple de 400.\n\nLe programme doit afficher « Année bissextile » ou « Année non bissextile » suivant le cas. " + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "Année bissextile\n" + } + ], + "source": "def bissextile(n):\n if (n % 4 == 0 and n % 100 != 0) or (n % 400 == 0):\n print(\"Année bissextile\")\n else:\n print(\"Année non bissextile\")\n\n\nannee = 2024\nbissextile(annee)" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "<h3 style=\"color:teal;background-color:azure;\" > <i class=\"fa fa-pencil\" aria-hidden=\"true\"> </i> Exercice 11 - Quizz </h3>\n\nCréez un quiz avec des questions à choix multiple sur un sujet de culture générale, dans le style des quiz sur le site Kahoot.\n\n- Complétez pour avoir 4 questions\n- Ajoutez le calcul du score" + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "trusted": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": "Quiz sur le thème : Disney\n\nQuel est le nom du cowboy dans Toy Story ?Pluto\nPerdu !\nVotre score est 0\n" + } + ], + "source": "print('Quiz sur le thème : Disney')\n\nscore = 0\n\n# Question 1 \nprint()\nquestion = \"Quel est le nom du cowboy dans Toy Story ?\"\nsolution = 'Woody'\n\nreponse = input(question)\nif reponse == solution:\n score = score +1\nelse:\n print(\"Perdu !\")\n \n\n\nprint('Votre score est', score)" + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "---\n\n#### Remarque générale\n\nCe document est une adaptation d'un ressource pédagogique tiré du catalogue modulo https://modulo-info.ch/. Il est sous license Creative Commons [BY-NC-SA](https://creativecommons.org/licenses/?lang=fr)\n\n\n " + } + ], + "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.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}