counter = [0 for _ in range(0,6)] votes = [2, 5, 3, 4, 1, 5, 1, 5, 5, 3] for x in votes: counter[x] += 1 cnt = 0 for c in counter: if c == 2: cnt += 1 print(cnt)
To embed this project on your website, copy the following code and paste it into your website's HTML: