I have a Python list and I want to know what\'s the quickest way to count the number of occurrences of the item, \'1\' in this list. In my actual case, the item
\'1\'
Combination of lambda and map function can also do the job:
list_ = ['a', 'b', 'b', 'c'] sum(map(lambda x: x=="b", list_)) :2