{ "cells": [ { "cell_type": "markdown", "id": "8c69e9ae", "metadata": {}, "source": [ "# Quelques rappels de Python\n", "Outils Numériques / Bloc 1 / Seance 1 / Exemple 1 " ] }, { "cell_type": "markdown", "id": "e9a0dd4a", "metadata": {}, "source": [ "## Utilisation des variables" ] }, { "cell_type": "markdown", "id": "f953fd59", "metadata": {}, "source": [ "> **Testez les instructions suivantes**\n", "\n", "Quelle est la différence entre les deux utilisations de la fonction print ?" ] }, { "cell_type": "code", "execution_count": null, "id": "e95a5d17", "metadata": {}, "outputs": [], "source": [ "a = 2 + 3\n", "a" ] }, { "cell_type": "code", "execution_count": null, "id": "603071bc", "metadata": {}, "outputs": [], "source": [ "print('a = ', a)" ] }, { "cell_type": "code", "execution_count": null, "id": "295897f9", "metadata": {}, "outputs": [], "source": [ "print(f'a = {a}')" ] }, { "cell_type": "markdown", "id": "2b67d146", "metadata": {}, "source": [ "## Utilisation des listes" ] }, { "cell_type": "markdown", "id": "d2f7dd3f", "metadata": {}, "source": [ "> **Créez une liste b contenant les éléments [1, 2, 3]**" ] }, { "cell_type": "code", "execution_count": null, "id": "91024c5d", "metadata": {}, "outputs": [], "source": [ "# TO DO" ] }, { "cell_type": "markdown", "id": "5ba6ef34", "metadata": {}, "source": [ "> Affichez cette liste" ] }, { "cell_type": "code", "execution_count": null, "id": "1fe09df1", "metadata": {}, "outputs": [], "source": [ "# TO DO" ] }, { "cell_type": "markdown", "id": "c93f8bd9", "metadata": {}, "source": [ "> Affichez le second élément de la liste (soit 2)" ] }, { "cell_type": "code", "execution_count": null, "id": "f321d5ea", "metadata": {}, "outputs": [], "source": [ "# TO DO" ] }, { "cell_type": "markdown", "id": "8cd3bab5", "metadata": {}, "source": [ "> Que contient la liste : c = b + b ?" ] }, { "cell_type": "code", "execution_count": null, "id": "f0b25f98", "metadata": {}, "outputs": [], "source": [ "# TO DO" ] }, { "cell_type": "markdown", "id": "cd6377d2", "metadata": {}, "source": [ "Réponse : " ] }, { "cell_type": "markdown", "id": "d0ed8dd4", "metadata": {}, "source": [ "## Calculs sur un ordinateur" ] }, { "cell_type": "markdown", "id": "50f3d529", "metadata": {}, "source": [ "> **Réalisez les deux calculs suivants et affichez le résultat**\n", "\n", "3 - 2 - 1\n", "\n", "0.3 - 0.2 - 0.1" ] }, { "cell_type": "code", "execution_count": null, "id": "e3188e67", "metadata": {}, "outputs": [], "source": [ "# TO DO" ] }, { "cell_type": "code", "execution_count": null, "id": "ab37c527", "metadata": {}, "outputs": [], "source": [ "# TO DO" ] }, { "cell_type": "markdown", "id": "c79c70ba", "metadata": {}, "source": [ "Les résultats sont-ils justes ?" ] } ], "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.9.16" } }, "nbformat": 4, "nbformat_minor": 5 }