diff --git a/module2/exo1/Premier_Test.ipynb b/module2/exo1/Premier_Test.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..b393c824a3429b93e2d6f6eefb8f546922d62b2a --- /dev/null +++ b/module2/exo1/Premier_Test.ipynb @@ -0,0 +1,112 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Fichier test de calculs en python" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## boucle for" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "1\n", + "2\n", + "3\n", + "4\n" + ] + } + ], + "source": [ + "for i in range(5): # ici un commentaire du code\n", + " print(i)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "texte simple comme un commentaire des résultats" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## test if / else" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "nombre pair\n" + ] + } + ], + "source": [ + "var1 = 10\n", + "print(var1 % 2)\n", + "if (var1 % 2) == 0:\n", + " print (\"nombre pair\"), var1\n", + "else:\n", + " print (\"nombre impair\"), var1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "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.6.4" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}