{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Qu'est-ce que Python ?\n", "cf. https://fr.wikipedia.org/wiki/Python_(langage)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* Python est un langage de programmation **interprété, multi-paradigme et multiplateformes**" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Hello, world!'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Hello, world!\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Hello, world!'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"Hello, \" + \"world!\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "1+2" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* Il favorise la **[programmation impérative](https://fr.wikipedia.org/wiki/Programmation_imp%C3%A9rative) [structurée](https://fr.wikipedia.org/wiki/Programmation_structur%C3%A9e), fonctionnelle et orientée objet**" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "on verra tout cela..." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* Il est doté d'un \n", " * d'un **typage dynamique [fort](https://fr.wikipedia.org/wiki/Typage_fort)**,\n", " " ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "can only concatenate str (not \"int\") to str", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m<ipython-input-4-48a28808618d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;34m\"Hello\"\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mTypeError\u001b[0m: can only concatenate str (not \"int\") to str" ] } ], "source": [ "\"Hello\" + 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " * d'une **gestion automatique de la mémoire par ramasse-miettes** et \n", " * d'un **système de gestion d'exceptions** ; il est ainsi similaire à Perl, Ruby, Scheme, Smalltalk et Tcl." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "ename": "ZeroDivisionError", "evalue": "division by zero", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m<ipython-input-5-9e1622b385b6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;36m1\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mZeroDivisionError\u001b[0m: division by zero" ] } ], "source": [ "1/0" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "division by zero\n" ] } ], "source": [ "try:\n", " 1/0\n", "except Exception as e:\n", " print(e)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Un petit peu d'histoire" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* Crée par Guido van Rossum, au \"Centrum voor Wiskunde en Informatica\" d'Amsterdam\n", "* 20 février 1991 : première version, v. 0.9.0\n", "* Décembre 2008 : publication de la version 3.0 \n", "* 24 février 2020 : publication de la version 3.8.2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Licence" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\"Python Software Foundation Licence\", cf. https://docs.python.org/3/license.html" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Implémentations du langage\n", "cf. https://fr.wikipedia.org/wiki/Python_(langage)#Impl%C3%A9mentations_du_langage" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Quelques distributions\n", "\n", "* https://www.anaconda.com/distribution/ : multi-plateforme, orientée Data Science\n", "* https://winpython.github.io/ : portable, pour Windows\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Principales utilisations de Python" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* https://www.quora.com/What-is-the-most-famous-software-written-in-Python" ] } ], "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.7.5" } }, "nbformat": 4, "nbformat_minor": 2 }