How to determine if any value occurs more than twice in a list?
How to determine if any value occurs more than twice in a list? I have a list and would like to determine if any value occurs more than twice. I've tried using collections and counter but I cannot get those to evaluate to a single True or False value. myArray=[1,1,1,1,1,1,1,1,2] I would like it to return: True if any value occurs more than twice . True Any help is appreciated and it would really help if the solution was fast. I'm checking hundreds of thousands of lists. I'm new to programming and this is my first post. Where is your attempt? I see no code? – antfuentes87 7 mins ago 2 Answers 2 You could always construct a histogram of the values and see if any entry is greater than two. It could look something like this: def is_more_than_...