From 49802b18e3c49a8803f3e57ea294baf47ea33e36 Mon Sep 17 00:00:00 2001 From: 4273f2ba61d873c01ff7dbef7231bb4c <4273f2ba61d873c01ff7dbef7231bb4c@app-learninglab.inria.fr> Date: Sun, 24 May 2020 09:20:46 +0000 Subject: [PATCH] deux cellules --- module2/exo1/Premier_Test.ipynb | 112 ++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 module2/exo1/Premier_Test.ipynb diff --git a/module2/exo1/Premier_Test.ipynb b/module2/exo1/Premier_Test.ipynb new file mode 100644 index 0000000..b393c82 --- /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 +} -- 2.18.1