Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
8
Task/Nth/Python/nth.py
Normal file
8
Task/Nth/Python/nth.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
_suffix = ['th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th']
|
||||
|
||||
def nth(n):
|
||||
return "%i'%s" % (n, _suffix[n%10] if n % 100 <= 10 or n % 100 > 20 else 'th')
|
||||
|
||||
if __name__ == '__main__':
|
||||
for j in range(0,1001, 250):
|
||||
print(' '.join(nth(i) for i in list(range(j, j+25))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue