def aire_rectangle(cig, csd):
longueur = abs(csd[0] - cig[0])
largeur = abs(csd[1] - cig[1])
return longueur * largeur
def min_max(tuple):
minimum = min(tuple)
maximum = max(tuple)
return (minimum, maximum)
def enumere(liste):
resultat = []
for i in range(len(liste)):
resultat.append((i, liste[i]))
return resultat
def enumere(liste):
resultat = []
for i in range(len(liste)):
resultat.append((i, liste[i]))
return resultat
def jeu_cartes():
couleurs = ["Pique", "Carreau", "Coeur", "Trèfle"]
noms = ["Deux", "Trois", "Quatre", "Cinq", "Six",
"Sept", "Huit", "Neuf", "Dix", "Valet",
"Dame", "Roi", "As"]
cartes = []
for couleur in couleurs:
for i in range(13):
cartes.append((couleur, i + 2, noms[i]))
return cartes
# Question 1
print("Question 1 :")
print(aire_rectangle((0, 0), (5, 3)))
# Question 2
print("Question 2 :")
print(min_max((4, 8, 2, 9, 1, 6)))
# Question 3
print("Question 3 :")
print(enumere(["pomme", "banane", "orange"]))
# Question 4
print("Question 4 :")
cartes = jeu_cartes()
print(cartes)
print("Nombre de cartes :", len(cartes))
To embed this project on your website, copy the following code and paste it into your website's HTML: