how do you split a list into evenly sized chunks 3f

Solutions on MaxInterview for how do you split a list into evenly sized chunks 3f by the best coders in the world

showing results for - "how do you split a list into evenly sized chunks 3f"
Christopher
29 Aug 2019
1def chunks(lst, n):
2    """Yield successive n-sized chunks from lst."""
3    for i in range(0, len(lst), n):
4        yield lst[i:i + n]
5