счетчик питона для списка кортежей
from collections import Counter
result = list(Counter(example).items())
[('apple', 2), ('pear', 1)]
Plif Plouf
from collections import Counter
result = list(Counter(example).items())
[('apple', 2), ('pear', 1)]