diff --git a/ProjetP4/TD_1.py b/ProjetP4/TD_1.py new file mode 100644 index 000000000..e69de29bb diff --git a/ProjetP4/puissance_4.py b/ProjetP4/puissance_4.py new file mode 100644 index 000000000..141b9c5ba --- /dev/null +++ b/ProjetP4/puissance_4.py @@ -0,0 +1 @@ +fqqsdvqshd \ No newline at end of file diff --git a/ProjetP4/test.y b/ProjetP4/test.y new file mode 100644 index 000000000..e69de29bb diff --git a/cours/02_structures_conditionnelles/02_Structures_conditionnelles_slides.ipynb b/cours/02_structures_conditionnelles/02_Structures_conditionnelles_slides.ipynb index 01f5ba421..7d67cbb28 100644 --- a/cours/02_structures_conditionnelles/02_Structures_conditionnelles_slides.ipynb +++ b/cours/02_structures_conditionnelles/02_Structures_conditionnelles_slides.ipynb @@ -1379,7 +1379,7 @@ "metadata": { "celltoolbar": "Diaporama", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.10.4 ('l1-python')", "language": "python", "name": "python3" }, @@ -1393,7 +1393,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "c40ec1b8fe39daf00984f8ba30325fc08ad307055404f66b6babdfa1fdac6336" + } } }, "nbformat": 4, diff --git a/cours/03_structures_iteratives/03_structures_iteratives.ipynb b/cours/03_structures_iteratives/03_structures_iteratives.ipynb index f201afd3e..a6c08c41d 100644 --- a/cours/03_structures_iteratives/03_structures_iteratives.ipynb +++ b/cours/03_structures_iteratives/03_structures_iteratives.ipynb @@ -129,13 +129,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Afficher les valeurs dans l'intervalle:\n", + "i = 1\n", + "i = 2\n", + "i = 3\n", + "i = 4\n", + "i = 5\n", + "i = 6\n", + "i = 7\n", + "i = 8\n", + "i = 9\n", + "i = 10\n", + "Terminé\n" + ] + } + ], "source": [ "print(\"Afficher les valeurs dans l'intervalle:\")\n", "for i in range(1, 11) :\n", @@ -237,13 +256,109 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Afficher les valeurs dans l intervalle:\n", + "i = 4\n", + "i = 3\n", + "i = 2\n", + "Terminé\n", + "Help on class range in module builtins:\n", + "\n", + "class range(object)\n", + " | range(stop) -> range object\n", + " | range(start, stop[, step]) -> range object\n", + " | \n", + " | Return an object that produces a sequence of integers from start (inclusive)\n", + " | to stop (exclusive) by step. range(i, j) produces i, i+1, i+2, ..., j-1.\n", + " | start defaults to 0, and stop is omitted! range(4) produces 0, 1, 2, 3.\n", + " | These are exactly the valid indices for a list of 4 elements.\n", + " | When step is given, it specifies the increment (or decrement).\n", + " | \n", + " | Methods defined here:\n", + " | \n", + " | __bool__(self, /)\n", + " | True if self else False\n", + " | \n", + " | __contains__(self, key, /)\n", + " | Return key in self.\n", + " | \n", + " | __eq__(self, value, /)\n", + " | Return self==value.\n", + " | \n", + " | __ge__(self, value, /)\n", + " | Return self>=value.\n", + " | \n", + " | __getattribute__(self, name, /)\n", + " | Return getattr(self, name).\n", + " | \n", + " | __getitem__(self, key, /)\n", + " | Return self[key].\n", + " | \n", + " | __gt__(self, value, /)\n", + " | Return self>value.\n", + " | \n", + " | __hash__(self, /)\n", + " | Return hash(self).\n", + " | \n", + " | __iter__(self, /)\n", + " | Implement iter(self).\n", + " | \n", + " | __le__(self, value, /)\n", + " | Return self<=value.\n", + " | \n", + " | __len__(self, /)\n", + " | Return len(self).\n", + " | \n", + " | __lt__(self, value, /)\n", + " | Return self integer -- return number of occurrences of value\n", + " | \n", + " | index(...)\n", + " | rangeobject.index(value) -> integer -- return index of value.\n", + " | Raise ValueError if the value is not present.\n", + " | \n", + " | ----------------------------------------------------------------------\n", + " | Static methods defined here:\n", + " | \n", + " | __new__(*args, **kwargs) from builtins.type\n", + " | Create and return a new object. See help(type) for accurate signature.\n", + " | \n", + " | ----------------------------------------------------------------------\n", + " | Data descriptors defined here:\n", + " | \n", + " | start\n", + " | \n", + " | step\n", + " | \n", + " | stop\n", + "\n" + ] + } + ], "source": [ "print('Afficher les valeurs dans l intervalle:')\n", "for i in range(4, 1, -1) :\n", @@ -265,13 +380,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Avant addition i = 1\n", + "Après addition i = 2\n", + "Avant addition i = 4\n", + "Après addition i = 5\n", + "Avant addition i = 7\n", + "Après addition i = 8\n", + "Avant addition i = 10\n", + "Après addition i = 11\n", + "Dernière valeur, i = 11\n", + "Terminé\n" + ] + } + ], "source": [ "for i in range(1, 11, 3) :\n", " print(\"Avant addition i =\", i)\n", @@ -309,13 +441,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "La somme vaut : 10\n" + ] + } + ], "source": [ "n = int(input(\"Entrez un nombre :\"))\n", "result = 0\n", @@ -421,13 +561,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "i = 1\n", + "i = 2\n", + "i = 3\n", + "i = 4\n", + "i = 5\n", + "i = 6\n", + "i = 7\n", + "i = 8\n", + "i = 9\n", + "Terminé\n" + ] + } + ], "source": [ "i = 1\n", "while i < 10 : \n", @@ -679,13 +836,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "slideshow": { "slide_type": "fragment" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1 est impair\n", + "3 est impair\n", + "5 est impair\n", + "7 est impair\n", + "9 est impair\n", + "11 est impair\n", + "13 est impair\n", + "15 est impair\n", + "17 est impair\n", + "19 est impair\n", + "Terminé\n" + ] + } + ], "source": [ "for i in range(1, 21) :\n", " if i % 2 == 0 :\n", @@ -825,7 +1000,7 @@ "metadata": { "celltoolbar": "Diaporama", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.10.4 ('l1-python')", "language": "python", "name": "python3" }, @@ -839,7 +1014,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "c40ec1b8fe39daf00984f8ba30325fc08ad307055404f66b6babdfa1fdac6336" + } } }, "nbformat": 4, diff --git a/cours/04_fonctions/04_fonctions.ipynb b/cours/04_fonctions/04_fonctions.ipynb index 6edf1881c..43ea3c4fc 100644 --- a/cours/04_fonctions/04_fonctions.ipynb +++ b/cours/04_fonctions/04_fonctions.ipynb @@ -653,7 +653,7 @@ "metadata": { "celltoolbar": "Diaporama", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.10.4 ('l1-python')", "language": "python", "name": "python3" }, @@ -667,7 +667,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.3" + "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "c40ec1b8fe39daf00984f8ba30325fc08ad307055404f66b6babdfa1fdac6336" + } } }, "nbformat": 4, diff --git a/exercises/TD01_prise_en_main/01_prise_en_main.ipynb b/exercises/TD01_prise_en_main/01_prise_en_main.ipynb index 237397fac..58173196e 100644 --- a/exercises/TD01_prise_en_main/01_prise_en_main.ipynb +++ b/exercises/TD01_prise_en_main/01_prise_en_main.ipynb @@ -44,7 +44,9 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "1+1" + ] }, { "cell_type": "markdown", @@ -62,7 +64,9 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "a= 1+1" + ] }, { "cell_type": "markdown", @@ -76,7 +80,9 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "a" + ] }, { "cell_type": "markdown", @@ -92,7 +98,9 @@ "tags": [] }, "outputs": [], - "source": [] + "source": [ + "print(a)" + ] }, { "cell_type": "markdown", @@ -108,7 +116,10 @@ "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "a = 1 + 1\n", + "a = a + 1" + ] }, { "cell_type": "markdown", @@ -124,7 +135,9 @@ "tags": [] }, "outputs": [], - "source": [] + "source": [ + "print(a)" + ] }, { "cell_type": "markdown", @@ -149,12 +162,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5 2\n" + ] + } + ], + "source": [ + "a= 5 \n", + "b= 2\n", + "print(a, b)" + ] }, { "cell_type": "markdown", @@ -165,12 +190,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2 5\n" + ] + } + ], + "source": [ + "a=5\n", + "b=2\n", + "a,b=b,a\n", + "print(a,b)\n" + ] }, { "cell_type": "markdown", @@ -181,12 +219,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a vaut 2 et b vaut 5\n" + ] + } + ], + "source": [ + "print(\"a vaut\", a, \"et b vaut\", b)" + ] }, { "cell_type": "markdown", @@ -197,12 +245,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "hello world\n" + ] + } + ], + "source": [ + "a= \"hello world\"\n", + "print(a)" + ] }, { "cell_type": "markdown", @@ -239,10 +298,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "float" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(5.0)\n" + ] }, { "cell_type": "markdown", @@ -259,10 +331,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "list" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type([5, 2])" + ] }, { "cell_type": "markdown", @@ -275,12 +360,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "le type de x est \n" + ] + } + ], + "source": [ + "x=5\n", + "print (\"le type de x est \") " + ] }, { "cell_type": "markdown", @@ -294,10 +390,12 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "v=6" + ] }, { "cell_type": "markdown", @@ -310,12 +408,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "unterminated string literal (detected at line 1) (2196359626.py, line 1)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m Input \u001b[1;32mIn [23]\u001b[1;36m\u001b[0m\n\u001b[1;33m print(v, \"=\", v //11, \"x 11 \"+\", v % 11)\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m unterminated string literal (detected at line 1)\n" + ] + } + ], + "source": [ + "print(v, \"=\", v //11, \"x 11 +\", v % 11)" + ] }, { "cell_type": "markdown", @@ -329,10 +438,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "9" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "3*(10//3)" + ] }, { "cell_type": "markdown", @@ -351,12 +473,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a=56\n", + "a % 2 == 0" + ] }, { "cell_type": "markdown", @@ -367,12 +503,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 25, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "115792089237316195423570985008687907853269984665640564039457584007913129639936 le nombre de chiffres est 78\n" + ] + } + ], + "source": [ + "print(2**256, \"le nombre de chiffres est\", len(str(2**256)))\n" + ] }, { "cell_type": "markdown", @@ -390,12 +536,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "a % 10" + ] }, { "cell_type": "markdown", @@ -406,12 +565,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 29, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "5" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "(a % 100) // 10" + ] }, { "cell_type": "markdown", @@ -425,12 +597,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "(0, 2, True, 6)" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "0,2+0,4 >= 0,6" + ] }, { "cell_type": "markdown", @@ -441,12 +626,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0.5\n" + ] + } + ], + "source": [ + "x=0.5 \n", + "x=x*2**30\n", + "print(int(x)/(2**30))\n", + "\n", + "\n" + ] }, { "cell_type": "markdown", @@ -730,7 +929,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.10.4 ('l1-python')", "language": "python", "name": "python3" }, @@ -744,9 +943,14 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6-final" + "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "c40ec1b8fe39daf00984f8ba30325fc08ad307055404f66b6babdfa1fdac6336" + } } }, "nbformat": 4, "nbformat_minor": 1 -} \ No newline at end of file +} diff --git a/exercises/TD02_structures_controle/02_structures_controle.ipynb b/exercises/TD02_structures_controle/02_structures_controle.ipynb index 10b551cbf..71cf3fb62 100644 --- a/exercises/TD02_structures_controle/02_structures_controle.ipynb +++ b/exercises/TD02_structures_controle/02_structures_controle.ipynb @@ -42,14 +42,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 29, "metadata": { "slideshow": { "slide_type": "notes" } }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Factors!\n" + ] + } + ], + "source": [ + "num1 = 15\n", + "num2 = 5\n", + "\n", + "if num1 % num2 == 0 or num2 % num1 == 0 :\n", + " print(\"Factors!\")\n", + "else :\n", + " print(\"not factors\")" + ] }, { "cell_type": "markdown", @@ -70,14 +86,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "slideshow": { "slide_type": "notes" } }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "School is cancelled\n" + ] + } + ], + "source": [ + "state = \"Georgia\"\n", + "if state == \"Georgia\" :\n", + " print(\"School is cancelled\")\n", + "elif state == \"New Jersey\" :\n", + " print (\"School isn't cancelled\")\n", + "elif state == \"North Carolina\" :\n", + " print(\"School is postponed\")\n", + "else :\n", + " print (\"School's status is unknown\")" + ] }, { "cell_type": "markdown", @@ -108,14 +142,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": { "slideshow": { "slide_type": "notes" } }, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "5" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "annee = 1997\n", + "1997 % 12" + ] }, { "cell_type": "markdown", @@ -132,14 +180,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": { "slideshow": { "slide_type": "notes" } }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Not freezing\n" + ] + } + ], + "source": [ + "temperature = -3.7\n", + "celsius = True\n", + "if temperature >= 32 :\n", + " print(\"Freezing\")\n", + "else :\n", + " print(\"Not freezing\")" + ] }, { "cell_type": "markdown", @@ -157,16 +220,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "slideshow": { "slide_type": "notes" } }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "année non bissextile\n" + ] + } + ], + "source": [ + "A = 2022 \n", + "if (A % 4 == 0 and A % 100 != 0) or A % 400 == 0:\n", + " print(\"année bissextile\")\n", + "else :\n", + " print(\"année non bissextile\")" + ] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "---\n", "\n", @@ -176,43 +255,105 @@ "\n", "1. Ecrire un programme qui permet d'afficher tous les nombres entre 1 et 10 (bornes incluses).\n", "2. Ecrire un programme se limitant à la boucle *for* qui permet d'afficher tous les nombres pairs entre 1 et 20 (bornes incluses). Proposer une deuxième solution en incluant une structure conditionnelle." - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Afficher les valeurs dans l'intervalle:\n", + "i = 1\n", + "i = 2\n", + "i = 3\n", + "i = 4\n", + "i = 5\n", + "i = 6\n", + "i = 7\n", + "i = 8\n", + "i = 9\n", + "i = 10\n", + "i= 2\n", + "i= 4\n", + "i= 6\n", + "i= 8\n", + "i= 10\n", + "i= 12\n", + "i= 14\n", + "i= 16\n", + "i= 18\n", + "i= 20\n" + ] + } + ], + "source": [ + "print(\"Afficher les valeurs dans l'intervalle:\")\n", + "for i in range(1, 11) :\n", + " print(\"i =\", i)\n", + "for i in range(2, 22, 2) :\n", + " print(\"i=\", i)" + ] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 7:**\n", " \n", "1. Ecrire un programme qui demande à l'utilisateur de saisir *n* nombres, *n* étant choisi par l'utilisateur, puis d'afficher la moyenne de ces nombres.\n", "\n", "2. Même question, mais l'utilisateur ne choisit pas à l'avance le nombre *n*, la procédure s'arrête quand il saisit le nombre -1.\n" - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "ename": "ValueError", + "evalue": "invalid literal for int() with base 10: ''", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32mc:\\Users\\Divya\\.vscode\\extensions\\l1-python\\exercises\\TD02_structures_controle\\02_structures_controle.ipynb Cellule 15\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[0;32m 3\u001b[0m s \u001b[39m=\u001b[39m \u001b[39m0\u001b[39m\n\u001b[0;32m 5\u001b[0m \u001b[39mfor\u001b[39;00m i \u001b[39min\u001b[39;00m \u001b[39mrange\u001b[39m (n) :\n\u001b[1;32m----> 6\u001b[0m x \u001b[39m=\u001b[39m \u001b[39mint\u001b[39;49m(\u001b[39minput\u001b[39;49m(\u001b[39m\"\u001b[39;49m\u001b[39msaisir un nombre\u001b[39;49m\u001b[39m\"\u001b[39;49m))\n\u001b[0;32m 7\u001b[0m s \u001b[39m=\u001b[39m s \u001b[39m+\u001b[39m x \n\u001b[0;32m 8\u001b[0m \u001b[39mreturn\u001b[39;00m s \u001b[39m/\u001b[39m n\n", + "\u001b[1;31mValueError\u001b[0m: invalid literal for int() with base 10: ''" + ] + } + ], + "source": [ + "n = int(input('nombre de nombre ?'))\n", + "\n", + "s = 0\n", + "\n", + "for i in range (n) :\n", + " x = int(input('saisir un nombre'))\n", + " s = s + x \n", + "print(s / n)\n" + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "s = 0\n", + "x = 0 \n", + "while x != -1 :\n", + " s s + x\n", + " x = int(input('saisir un nombre'))\n", + "print (s / n)" + ] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 8:**\n", "\n", @@ -221,23 +362,51 @@ "\n", "1. Une première version en utilisant la boucle *for*\n", "2. Une seconde version en utilisant la boucle *while*" - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "24\n" + ] + } + ], + "source": [ + "f = 1\n", + "n = 4\n", + "for i in range(2, n + 1) :\n", + " f = f*i\n", + "print(f)" + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "24\n" + ] + } + ], + "source": [ + "f = 1\n", + "i = 2\n", + "n = 4\n", + "while i <= n :\n", + " f = f*i\n", + " i = i + 1\n", + "print(f)" + ] }, { "cell_type": "markdown", @@ -269,14 +438,30 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": { "slideshow": { "slide_type": "notes" } }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n" + ] + } + ], + "source": [ + "n = 0\n", + "for i in range(5) :\n", + " reponse = input(\"le nombre est-il dans l'ensemble\" + str(i + 1) + \" ? \")\n", + " if reponse =='oui' :\n", + " n= n + 2**i\n", + "\n", + "print(n)\n" + ] }, { "cell_type": "markdown", @@ -298,79 +483,180 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": { "slideshow": { "slide_type": "notes" } }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "perdu\n", + "le bon nombre était 46\n" + ] + } + ], + "source": [ + "import random \n", + "\n", + "d = random.randint(0, 9)\n", + "u = random.randint(0, 9)\n", + "n = int(input(\"saisir un nombre à (au plus) deux chiffres\"))\n", + "a = n // 10\n", + "b = n % 10\n", + "\n", + "if d == a and u == b :\n", + " print(\"gagné 10 000 €\")\n", + "elif d == b and u == a :\n", + " print(\"gagné 3 000 €\")\n", + "elif d == a or d == b or u == a or u == b :\n", + " print(\"gagné 1 000 €\")\n", + "else :\n", + " print(\"perdu\")\n", + "print(\"le bon nombre était\", d*10 + u)" + ] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 11:**\n", " \n", "Ecrire un programme qui permet de calculer la somme des chiffres d'un entier *n* donné. Le nombre *n* doit être compris entre 10 et 20 (bornes incluses)." - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "46\n" + ] + } + ], + "source": [ + "n = 2457467542 \n", + "s = 0\n", + "while n != 0 :\n", + " s = s + n % 10\n", + " n = n // 10\n", + "print(s)" + ] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 12:**\n", "\n", "1. Ecrire un programme qui permet de générer aléatoirement deux nombres entre 0 et 9, de calculer leurs différences (en valeur absolue), puis d'inviter l'utilisateur à répondre à la question suivante *que vaut abs(number1 - number2)?*. Le programme doit permettre à l'utilisateur de répondre plusieurs fois jusqu'à la saisie de la bonne réponse.\n", "2. Modifier le programme précédent de telle sorte qu'il génère cinq occurences à la suite invitant à répondre à la question précédente. A la fin, le programme affiche le nombre moyen de tentatives qu'il a fallu à l'utilisateur pour répondre à une question." - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gagné, l'écart était 0 avec les nombres 9 9\n" + ] + } + ], + "source": [ + "import random\n", + "\n", + "x = random.randint(0, 9)\n", + "y = random.randint(0, 9)\n", + "ecart = abs(x - y)\n", + "reponse = None\n", + "while reponse != ecart :\n", + " reponse = int(input(\"proposer un écart\"))\n", + "print(\"gagné, l'écart était\", ecart, \"avec les nombres\", x, y)\n" + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "gagné en 7 coup(s) l'écart était 6 avec les nombres 2 8\n", + "gagné en 5 coup(s) l'écart était 1 avec les nombres 2 1\n", + "gagné en 9 coup(s) l'écart était 0 avec les nombres 2 2\n", + "gagné en 4 coup(s) l'écart était 4 avec les nombres 9 5\n", + "gagné en 6 coup(s) l'écart était 0 avec les nombres 7 7\n", + "6.2\n" + ] + } + ], "source": [ - "\n" + "s = 0\n", + "for tour in range(5) :\n", + " x = random.randint(0, 9)\n", + " y = random.randint(0, 9)\n", + " ecart = abs(x - y)\n", + " reponse = None\n", + " tentatives = 0\n", + " while reponse != ecart :\n", + " reponse = int(input(\"proposer un écart\"))\n", + " tentatives = tentatives + 1\n", + " print(\"gagné en\", tentatives, \"coup(s) l'écart était\", ecart, \"avec les nombres\", x, y)\n", + " s = s + tentatives\n", + "print(s / 5)\n" ] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 13:**\n", "\n", "Ecrire un programme qui permet de calculer le nombre de mots dans une phrase saisie par l'utilisateur." - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "nombre de mots: 4\n" + ] + } + ], "source": [ - " " + "# on compte le nombre d'espaces et on ajoute 1\n", + "\n", + "phrase = input('saisir une phrase')\n", + "nb_espaces = 0\n", + "for caractère in phrase :\n", + " if caractère == ' ':\n", + " nb_espaces = nb_espaces + 1\n", + "\n", + "print('nombre de mots:', nb_espaces + 1)" ] }, { @@ -488,6 +774,8 @@ "source": [] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 17:**\n", "\n", @@ -500,20 +788,36 @@ "*****\n", "******\n", "```" - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "metadata": { "tags": [] }, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "*\n", + "**\n", + "***\n", + "****\n", + "*****\n", + "******\n" + ] + } + ], + "source": [ + "for i in range(1, 7) :\n", + " print(i* \"*\")" + ] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 18:**\n", "\n", @@ -526,9 +830,7 @@ " *****\n", "******\n", "```" - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", @@ -540,13 +842,13 @@ "source": [] }, { + "cell_type": "markdown", + "metadata": {}, "source": [ "**Exercice 19:**\n", "\n", "Ecrire un programme qui calcule, étant donné un entier *n* rentré par l'utilisateur, la plus grande puissance de *n* inférieure à un million." - ], - "cell_type": "markdown", - "metadata": {} + ] }, { "cell_type": "code", @@ -561,7 +863,7 @@ "metadata": { "celltoolbar": "Diaporama", "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.10.4 ('l1-python')", "language": "python", "name": "python3" }, @@ -575,9 +877,14 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6-final" + "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "c40ec1b8fe39daf00984f8ba30325fc08ad307055404f66b6babdfa1fdac6336" + } } }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/exercises/TD02_structures_controle/exercices kholle.ipynb b/exercises/TD02_structures_controle/exercices kholle.ipynb new file mode 100644 index 000000000..7dc649617 --- /dev/null +++ b/exercises/TD02_structures_controle/exercices kholle.ipynb @@ -0,0 +1,260 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "cannot assign to expression here. Maybe you meant '==' instead of '='? (870151810.py, line 3)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m Input \u001b[1;32mIn [4]\u001b[1;36m\u001b[0m\n\u001b[1;33m if (i % 3) = 1:\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m cannot assign to expression here. Maybe you meant '==' instead of '='?\n" + ] + } + ], + "source": [ + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "hello\n", + "hello\n" + ] + } + ], + "source": [ + "for i in range(5):\n", + " if (i % 3) == 1:\n", + " print(\"hello\")" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n", + "True\n" + ] + } + ], + "source": [ + "a, b = 3, 2\n", + "\n", + "c, d = \"toto\", \"tata\"\n", + "\n", + "print(a > b and d > c)\n", + "\n", + "print(a != b or d == c)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5 4\n" + ] + } + ], + "source": [ + "i, j = 0, 9\n", + "\n", + "while i < j:\n", + "\n", + " i = i + 1\n", + "\n", + " j = j - 1\n", + "\n", + "print(i,j)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "'continue' not properly in loop (1477511495.py, line 6)", + "output_type": "error", + "traceback": [ + "\u001b[1;36m Input \u001b[1;32mIn [9]\u001b[1;36m\u001b[0m\n\u001b[1;33m continue\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m 'continue' not properly in loop\n" + ] + } + ], + "source": [ + "a, b = 0, 1\n", + "\n", + "for i in range(0,5):\n", + " a += 1\n", + "if a % 3 != 0:\n", + " continue \n", + "b *= 2\n", + "print(a, b)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "#exercice 2\n", + "import random\n", + "\n", + "x = random.randint(10, 99)\n", + "y = int(input(\"saisissez un chiffre\"))\n", + "if y >= 1 and x % y == 0 :\n", + " print(\"Diviseur\")" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "var1 = 34\n", + "var2 = 7\n", + "\n", + "if var1>0 and var2>0 or var1<0 and var2<0 :\n", + " var1, var2 = var2, var1\n", + "else :\n", + " x = var1**var2\n", + " var2 = var1*var2\n", + " var1 = x\n" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6\n" + ] + } + ], + "source": [ + "#exercice 1\n", + "\n", + "a = 120\n", + "b = 54\n", + "\n", + "for x in range (a, 0, -1):\n", + " if a % x == 0 and b % x == 0 :\n", + " print(x)\n", + " break" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1518\n" + ] + } + ], + "source": [ + "#exercice 2\n", + "\n", + "somme = 0\n", + "n = int(input(\"âge ?\"))\n", + "for i in range (1, n + 1):\n", + " somme = somme + 120 + 3*i\n", + "print(somme)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n", + "9\n", + "8\n", + "7\n", + "6\n", + "5\n", + "4\n", + "3\n", + "2\n", + "1\n" + ] + } + ], + "source": [ + "#exercice 3\n", + "\n", + "n = int(input(\"saisir un nombre\"))\n", + "for i in range(n-1, n-11, -1) :\n", + " print(i)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3.10.4 ('l1-python')", + "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.4" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "c40ec1b8fe39daf00984f8ba30325fc08ad307055404f66b6babdfa1fdac6336" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/exercises/TD02_structures_controle/kholle.ipynb b/exercises/TD02_structures_controle/kholle.ipynb new file mode 100644 index 000000000..e69de29bb diff --git a/exercises/TD04_listes/04_listes.ipynb b/exercises/TD04_listes/04_listes.ipynb index 5ef60e5fa..0aa7d34bb 100644 --- a/exercises/TD04_listes/04_listes.ipynb +++ b/exercises/TD04_listes/04_listes.ipynb @@ -22,10 +22,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3, 5, 10]\n" + ] + } + ], + "source": [ + "liste = [3, 5, 10]\n", + "print(liste)" + ] }, { "cell_type": "markdown", @@ -36,10 +47,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3, 5, 10, 12, 17]\n" + ] + } + ], + "source": [ + "liste.append(12)\n", + "liste.append(17)\n", + "print(liste)" + ] }, { "cell_type": "markdown", @@ -50,10 +73,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3, 5, -7, 12, 17]\n" + ] + } + ], + "source": [ + "liste[2] = -7\n", + "print(liste)" + ] }, { "cell_type": "markdown", @@ -64,10 +98,23 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[6, 10, -14, 24, 34]\n" + ] + } + ], + "source": [ + "for i in range(5) :\n", + " liste[i] = liste[i] * 2\n", + "\n", + "print(liste)" + ] }, { "cell_type": "markdown", @@ -78,10 +125,23 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[24, 41, -54, 99, 140]\n" + ] + } + ], + "source": [ + "for i in range(5):\n", + " liste[i] = liste[i] + i\n", + "\n", + "print(liste)\n" + ] }, { "cell_type": "markdown", @@ -92,10 +152,31 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[81, 56, 54, 16, 72, 83, 87, 27, 81, 90]\n", + "somme : 647\n", + "le plus grand : 90\n" + ] + } + ], + "source": [ + "import random\n", + "tirage = []\n", + "for i in range(10):\n", + " tirage.append(random.randint(10, 99))\n", + "\n", + "#ou : tirage = [random.randint(10, 99) for i in range (10)]\n", + "\n", + "print(tirage)\n", + "print(\"somme :\" , sum(tirage))\n", + "print(\"le plus grand :\" , max(tirage))" + ] }, { "cell_type": "markdown", @@ -106,10 +187,33 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pairs : [56, 54, 16, 72, 90]\n", + "imapirs : [81, 83, 87, 27, 81]\n" + ] + } + ], + "source": [ + "pairs = []\n", + "impairs = []\n", + "\n", + "for n in tirage:\n", + " if n % 2 == 0:\n", + " pairs.append(n)\n", + " else:\n", + " impairs.append(n)\n", + "\n", + "# ou : pairs = [n for n in tirage if n % 2 == 0]\n", + "# imapairs = [n for n in tirage if n % 2 == 1]\n", + "print(\"pairs :\" , pairs)\n", + "print(\"imapirs :\" , impairs)\n" + ] }, { "cell_type": "markdown", @@ -120,10 +224,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[54, 56, 72, 81, 81, 83]\n" + ] + } + ], + "source": [ + "tirage.sort()\n", + "print(tirage)" + ] }, { "cell_type": "markdown", @@ -134,10 +249,23 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[56, 72, 81, 81]\n" + ] + } + ], + "source": [ + "del tirage[0]\n", + "del tirage[-1]\n", + "\n", + "print(tirage)" + ] }, { "cell_type": "markdown", @@ -148,10 +276,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]\n" + ] + } + ], + "source": [ + "paquet = list(range(1, 53))\n", + "\n", + "print(paquet)" + ] }, { "cell_type": "markdown", @@ -162,10 +302,25 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[44, 45, 46, 47, 48, 49, 50, 51, 52, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43]\n" + ] + } + ], + "source": [ + "i = random.randint(0, 51)\n", + "debut = paquet[:i]\n", + "fin = paquet[i:]\n", + "\n", + "paquet = fin + debut\n", + "print(paquet)" + ] }, { "cell_type": "markdown", @@ -433,7 +588,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3.10.4 ('l1-python')", "language": "python", "name": "python3" }, @@ -447,7 +602,12 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.10.4" + }, + "vscode": { + "interpreter": { + "hash": "c40ec1b8fe39daf00984f8ba30325fc08ad307055404f66b6babdfa1fdac6336" + } } }, "nbformat": 4, diff --git a/exercises/hello/hello.py b/exercises/hello/hello.py index 1dbbb857f..859c0025e 100644 --- a/exercises/hello/hello.py +++ b/exercises/hello/hello.py @@ -1,2 +1,2 @@ -msg = "" -print() +msg = "hello world" +print(msg.capitalize ()) diff --git a/h b/h new file mode 100644 index 000000000..e69de29bb