# Type Hint

*noun*

say it: **“TYP HINT”** **/taɪp hɪnt/**

A note in Python code saying what type a variable, parameter or return value should be, such as price: float; Python doesn't enforce it, but editors and tools use it.

## What is a **type hint**?

A **type hint** notes what type a variable, parameter or return value should be. Python doesn't enforce it, but editors and tools use it to catch mistakes early.

```python
def total_price(price: float, quantity: int) -> float:
    return price * quantity
```

## In a sentence

- “The **type hint** -> float says total_price gives back a decimal number.”
- “mypy read the **type hints** and caught a string passed as a quantity.”

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

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/type-hint
