diff --git a/module2/exo1/PolyL2.ipynb b/module2/exo1/PolyL2.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..b6606970e5dcc62726818e1ade2d897421a97cf2 --- /dev/null +++ b/module2/exo1/PolyL2.ipynb @@ -0,0 +1,120 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Correction du poly d'introduction à l'informatique pour la biologie" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exercice 1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Ecrire un programme qui définit 3 objets : un de type texte, un de type entier, un de type réel et qui enseuite affiche les valeurs et le type de ces objets." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Voici une chaine de caractères est un objet de type : \n", + "3 est un objet de type : \n", + "2.0 est un objet de type : \n" + ] + } + ], + "source": [ + "# Définition des objets \n", + "x = \"Voici une chaine de caractères\"\n", + "y = 3\n", + "z = 2.0\n", + "\n", + "# Aaffichage des valeurs et des types\n", + "print(x,\" est un objet de type : \",type(x))\n", + "print(y,\" est un objet de type : \",type(y))\n", + "print(z,\" est un objet de type : \",type(z))" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "hideCode": true, + "hideOutput": true + }, + "source": [ + "## Exercice 2" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Consigne** : Ecrire un programme qui définite deux objets réels a et b puis qui calcule leurs somme et affiche le résultat de façon explicite" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "La somme de 3.72 et 10.25 vaut 13.97 \n", + "\n" + ] + } + ], + "source": [ + "# Définition des objets \n", + "a = 3.72\n", + "b = 10.25\n", + "\n", + "# Calcul et affichage\n", + "print(\"La somme de \",a,\" et \",b,\" vaut \",a+b,\"\\n\")" + ] + }, + { + "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 +}