human
What is a code to pascal 's Triangle and the other steps required given the following:
Pascal 's Triangle | binomialCoeff.
A simple O ( n ^ 3 ) program for Pascal ' s ▁ Triangle ▁ Function ▁ to ▁ print ▁ first ▁ n ▁ lines ▁ of ▁ Pascal ' s Triangle.
Iterate through every line and print entries in it.
Every line has number of integers equal to line number.
Driver program"
Solution in Python:
assistant
#Here is code to pascal 's Triangle and the other steps required.
 def binomialCoeff ( n , k ) :
	res = 1
	if ( k > n - k ) :
		k = n - k
	for i in range ( 0 , k ) :
		res = res * ( n - i )
		res = res // ( i + 1 )
	return res
def printPascal ( n ) :
	for line in range ( 0 , n ) :
		for i in range ( 0 , line + 1 ) :
			print ( binomialCoeff ( line , i ) , " ▁ " , end = " " )
		print ( )
n = 7
printPascal ( n )