def ordinal(n):
    """
    Returns the ordinal value of n, e.g. 1st, 2nd, 3rd

    From https://leancrew.com/all-this/2020/06/ordinals-in-python/
    """
    suffix = ("th", "st", "nd", "rd") + ("th",) * 10
    v = n % 100
    if v > 13:
        return f"{n}{suffix[v % 10]}"
    else:
        return f"{n}{suffix[v]}"