30 seconds of pythonBack to Home
Splits values into two groups according to a function, which specifies which group an element in the input list belongs to.
If the function returns
True, the element belongs to the first group; otherwise, it belongs to the second group.
Use list comprehension to add elements to groups, based on