Identify Same-Name Items in a List
I'm wondering if there's a slick way to identify items in a list that are duplicates of each other. My list looks like this:
values = {"ABC", "DEF", "Per", "Per", "Per", "Per", "Per", "XYZ", "UVW"};
I want to return all of the positions of "Per" in the list. I.e.
[3, 4, 5, 6, 7]
I can loop over the list to get the answer. But is there another way that avoids the loop?