Every line of 'python create list with n elements' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
38 def fun(x, N): 39 return make_list(*[x for _ in range(N)])
12 def fill_list(dims, l): 13 if len(dims) == 1: 14 for i in xrange(dims[0]): 15 if callable(init): 16 l[i] = init() 17 else: 18 l[i] = init 19 else: 20 for i in xrange(dims[0]): 21 fill_list(dims[1:], l[i])