Partition Array

Split an array into two groups based on a condition.

Code

General
[[x for x in arr if x % 2 == 0], [x for x in arr if x % 2 != 0]]

Parameters

Array to partition

Server

More Python Snippets