How to create a list which contains the number of times an element appears in a number of lists. for example I have these lists:
list1 = ['apples','oranges','grape']
list2 = ['oranges, 'oranges', 'pear']
list3 = ['strawberries','bananas','apples']
list4 = [list1,list2,list3]
I want to count the number of documents that contain each element and put it in a dictionary, so for apples^and oranges I get this:
term['apples'] = 2
term['oranges'] = 2 #not 3