![](//s1.studylibfr.com/store/data-gzf/f5b970548018e7be9951d4758a04e5ce/1/010049182.htmlex.zip/bg2.jpg)
som = som + tab_temp_2019[month][jr][h]
return (som/11)
#print(temp_moy_journée(jr=5,month=2))
#Q6
def afficher_moyenne_mars():
for j in range(31):
print(j,'/',3,'/',2019,':',temp_moy_journée(j,3))
#print(afficher_moyenne_mars())
#---------------------------------------------------Fonction récursive et itérative ---------------------------
#Q1 :
def factorielle_it(n):
fact = 1
for i in range(n,0,-1) :
fact = fact * i
return fact
#print(factorielle_it(6))
#Q2 :
def factorielle_rec(n):
if n < 2 : return 1
else :
return n*factorielle_rec(n-1)
#print(factorielle_rec(6))
#Q3
def combinaison_it(p,n):
if p == 0 or p == n: return 1
else:
return (factorielle_rec(n)/(factorielle_rec(p)*factorielle_rec(n-p)))
print(combinaison_it(6,49))
#Q4
def combinaison_rec(p,n):
if p == 0 or p == n : return 1
else :
return combinaison_rec(p,n-1) + combinaison_rec(p-1,n-1)
print(combinaison_rec(6,49))