ajout de tous les cours et TP préparés cet été
This commit is contained in:
10
Recursivité/TP/Triangle_Pascal.py
Normal file
10
Recursivité/TP/Triangle_Pascal.py
Normal file
@@ -0,0 +1,10 @@
|
||||
def coef(n,p):
|
||||
if p==0 or n == p :
|
||||
return 1
|
||||
else :
|
||||
return coef(n-1,p-1) + coef(n-1,p)
|
||||
|
||||
for i in range(19):
|
||||
for j in range(i+1):
|
||||
print(coef(i,j),' ',end='')
|
||||
print()
|
||||
Reference in New Issue
Block a user