Quantcast
Channel: User Mark - Stack Overflow
Viewing all articles
Browse latest Browse all 44

Answer by Mark for What is the most efficient way to split a list evenly in half

$
0
0

This works and seems like a simple way:

def splitList(array):    n = len(array)    half = int(n/2) # py3    return array[:half], array[n-half:]

Viewing all articles
Browse latest Browse all 44

Latest Images

Trending Articles



Latest Images