PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#Brackets below the line
#N+1
#end instead of sep
"""
Input the number of row you want form KHYAM_PASCL
triangle(i.e power n of {(a + b) to the power of n})
to get the coefficient of binomial expansion.
"""
import math
def combination(n,r):
return int((math.factorial(n))/((math.factorial(r))*(math.factorial(n-r))))
N=int(input())
for i in range(N+1):
print(combination(N,i),end=' ')
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run