Source code for kyu_8.enumerable_magic_25.take

"""
Solution for -> Enumerable Magic #25 - Take the First N Elements.

Created by Egor Kostan.
GitHub: https://github.com/ikostan
"""


[docs] def take(arr: list, n: int) -> list: """ 'take' function. Accepts a list/array and a number n, and returns a list/array of the first n elements from the list/array. :param arr: list :param n: int :return: list """ return arr[:n]