def ordinalize(n):
    """
    Ordinalize a number.

    Examples
    --------
    >>> [ordinalize(n) for n in range(1, 4 + 1)]
    ['1st', '2nd', '3rd', '4th']

    """
    mapper = {
        1: 'st',
        2: 'nd',
        3: 'rd',
    }
    return str(n) + mapper.get(n % 10, 'th')