def binomial_coefficients_list(n):
 d = ([1] * (n + 1))
 a = 1
 for k in range(1, ((n // 2) + 1)):
  a = ((a * ((n - k) + 1)) // k)
  d[k] = d[(n - k)] = a
 return d

def binomial_coefficients_list ( n ) : d = ( [ 1 ] * ( n + 1 ) ) a = 1 for k in range ( 1 , ( ( n // 2 ) + 1 ) ) : a = ( ( a * ( ( n - k ) + 1 ) ) // k ) d [ k ] = d [ ( n - k ) ] = a return d
return a list of binomial coefficients as rows of the pascals triangle .