标签: python list duplicates
我有一个包含重复项的列表,例如
l = ["north", "north", "east", "north", "east", "east"]
我希望最终列表像这样
l = ["north1", "north2", "east1", "north3", "east2", "east3"]
什么是实现此目标的好方法?