From 372c9184af925e9e658dfc54d10488328aa7b7f0 Mon Sep 17 00:00:00 2001 From: Nadou Emmanuella LAWSON-LARTEGO Date: Tue, 3 Dec 2024 18:55:20 +0100 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"/"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Fonction3.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Fonction3.py diff --git a/Fonction3.py b/Fonction3.py new file mode 100644 index 0000000..3d86d3e --- /dev/null +++ b/Fonction3.py @@ -0,0 +1,12 @@ +def Function3(x): + valeur = 0 # Initialisation + if x < 0: # Cas où x est négatif + valeur = -x + if x == 0: # Cas où x est égal à 0 + pass # Ne fait rien + if x > 0: # Cas où x est positif + valeur = x + return valeur +print(Function3(-10)) # Exemple avec x = -10 +print(Function3(0)) # Exemple avec x = 0 +print(Function3(7)) # Exemple avec x = 7