# Higher-Order Function

*noun*

say it: **“HY-er OR-der FUNK-shun”** **/ˈhaɪər ˈɔrdər ˈfʌŋkʃən/**

A function that takes another function as a value, or hands one back.

## What is a **higher-order function**?

A **higher-order function** takes another function as an argument, or hands one back. `sorted()` with a `key` is one you already use.

```python
def apply_discount(prices, rule):
    return [rule(price) for price in prices]

def half_off(price):
    return price / 2

print(apply_discount([20, 50], half_off))  # [10.0, 25.0]
```

## In a sentence

- “Checkout became a **higher-order function** when it started taking this week's deal as a function.”

Level: Journeyman · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=3)

Updated: November 9, 2026

## In other subjects

- [Higher-Order Function in JavaScript](https://www.ask-codey.com/glossary/higher-order-function-javascript)
- [Higher-Order Function in Software Development](https://www.ask-codey.com/glossary/higher-order-function-software-development)

Source: https://www.ask-codey.com/glossary/higher-order-function
