---
name: take
kind: function
lang: py
domain: core
version: "1.0.0"
purity: pure
signature: "def take(xs: list, n: int) -> list"
description: "Toma los primeros n elementos de una lista."
tags: [list, functional, take, slice, python, pendiente-usar]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: []
params:
  - name: xs
    desc: "Lista de la que tomar elementos"
  - name: n
    desc: "Número de elementos a tomar desde el inicio"
output: "Lista con los primeros n elementos"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/core/core.py"
---

## Ejemplo

```python
result = take([1, 2, 3, 4, 5], 3)
# [1, 2, 3]
```

## Notas

Funcion pura. Si n > len(xs), retorna toda la lista. No muta la original.
