Home / Python Tips Generated By ChatGPT / Using collections.Counter in Python Count unique items in a list or string. Source Code from collections import Counter counts = Counter("banana") print(counts)