Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

15
Task/Nth/Python/nth-2.py Normal file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
def ord(n):
try:
s = ['st', 'nd', 'rd'][(n-1)%10]
if (n-10)%100//10:
return str(n)+s
except IndexError:
pass
return str(n)+'th'
if __name__ == '__main__':
print(*(ord(n) for n in range(26)))
print(*(ord(n) for n in range(250,266)))
print(*(ord(n) for n in range(1000,1026)))