Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- suffixes = {"1": "st", "2": "nd", "3": "rd"}
- def positioner(rang, dog_position):
- positions = []
- for i in range(1, rang + 1):
- if str(i) == str(dog_position):
- continue
- if str(i) in ["11", "12", "13"]:
- positions.append(str(i)+ "th")
- else:
- positions.append(str(i) + suffixes.get(str(i)[-1], "th"))
- return positions
- if __name__ == "__main__":
- positions = positioner(100, 12)
- print positions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement