Created
November 13, 2014 10:53
-
-
Save martynjarvis/544cc0258cb99f2661ff to your computer and use it in GitHub Desktop.
Cardinal to Ordinal Numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From Sam | |
ord = lambda n: "%d%s" %(n ,"tsnrhtdd" [(n/10%10!=1)*(n%10<4)*n%10::4]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment