找出 ['a', 'b', 'c', 'd', 'a'] 当中重复的元素和位置
['a', 'b', 'c', 'd', 'a']
a = ['a', 'b', 'c', 'd', 'a', 'c'] b = [(x, y) for x, y in enumerate(a) if a.count(y) > 1] print(b)