def getDaySuffix(day):
    """Return st, nd, rd, or th for supplied day."""

    if 4 <= day <= 20 or 24 <= day <= 30:
        return 'th'
    return ['st', 'nd', 'rd'][day % 10 - 1]
Return st, nd, rd, or th for supplied day.
recipes/Python/576807_Send_Email/recipe-576807.py