Récapitulatif

Introduction aux fonctions en Python

Hugo Bowne-Anderson

Instructor

Ce que vous avez appris :

  • Comment écrire des fonctions

    • Accepter plusieurs paramètres

    • Renvoyer plusieurs valeurs

  • À suivre : Fonctions d'analyse des données Twitter

Introduction aux fonctions en Python

Les éléments fondamentaux d'une fonction

  • En-tête de la fonction
def raise_both(value1, value2):
  • Corps de la fonction
    """Raise value1 to the power of value2
    and vice versa."""

    new_value1 = value1 ** value2          
    new_value2 = value2 ** value1

    new_tuple = (new_value1, new_value2)

    return new_tuple
Introduction aux fonctions en Python

Passons à la pratique !

Introduction aux fonctions en Python

Preparing Video For Download...