Exo 3 à finir

This commit is contained in:
Aissi Jude Christ
2025-10-15 12:59:56 +02:00
parent 80cb738b02
commit 0cd6879290
3 changed files with 45 additions and 0 deletions

29
fonctions.py Normal file
View File

@@ -0,0 +1,29 @@
def function(tableau1, tableau2):
presentDansDeuxListes = 0
for nombre1 in tableau1:
for (nombre2 in tableau2):
if (nombre1 == nombre2):
presentDansDeuxListes += 1
break
return presentDansDeuxListes
def funtion_2(x):
valeur = 0
while (x > 0):
valeur = valeur + x
x -= 1
return valeur
def function_3(x):
valeur = 0
if (x < 0):
valeur = -x
if (x == 0):
pass
if (x > 0):
valeur = x
return valeur