---
name: partition
kind: function
lang: py
domain: core
version: "1.0.0"
purity: pure
signature: "def partition(xs: list, pred: callable) -> tuple"
description: "Divide una lista en dos: (elementos que cumplen el predicado, elementos que no)."
tags: [list, functional, partition, split, python, pendiente-usar]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: []
params:
  - name: xs
    desc: "Lista a dividir"
  - name: pred
    desc: "Función predicado que retorna True/False"
output: "Tupla (elementos_que_cumplen, elementos_que_no_cumplen)"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/core/core.py"
---

## Ejemplo

```python
evens, odds = partition([1, 2, 3, 4, 5], lambda n: n % 2 == 0)
# evens = [2, 4], odds = [1, 3, 5]
```

## Notas

Funcion pura. Retorna tupla de dos listas: (matches, non_matches).
