MCPcopy Create free account
hub / github.com/ActiveState/code / getDaySuffix

Function getDaySuffix

recipes/Python/576807_Send_Email/recipe-576807.py:129–134  ·  view source on GitHub ↗

Return st, nd, rd, or th for supplied day.

(day)

Source from the content-addressed store, hash-verified

127 sys.exit(SYS_EXIT_CODE_SUCCESSFUL)
128
129def getDaySuffix(day):
130 """Return st, nd, rd, or th for supplied day."""
131
132 if 4 <= day <= 20 or 24 <= day <= 30:
133 return 'th'
134 return ['st', 'nd', 'rd'][day % 10 - 1]
135
136def printProgramStatus(started, stream=sys.stdout):
137 """Print program duration information."""

Callers 1

printProgramStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected