Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_ordinal(n):
- my_dict = {1:'first', 2:'second', 3:'third', 4:'fourth', 5:'fifth',6:'sixth', 7:'seventh',8:'eighth',9:'ninth',10:'tenth', 11:'eleventh', 12:'twelfth' }
- if isinstance(n,int):
- if n in my_dict.keys():
- return my_dict.get(n)
- else:
- return ''
- print(get_ordinal(1))
Advertisement
Add Comment
Please, Sign In to add comment