python split list into n sublists

Solutions on MaxInterview for python split list into n sublists by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "python split list into n sublists"
Amelie
17 May 2016
1[input[i:i+n] for i in range(0, len(input), n)]        # Use xrange in py2k
2