python equivalent of filter() getting two output lists (i.e. partition of a list) python equivalent of filter() getting two output lists (i.e. partition of a list) python python