Hi what I am trying to do is count the specific occurrences of the characters common to each string in the list below and print out each string and how many times the common characters appear example barack a appears 2 barack r appears 1 when I run my code it prints that each character appears 1
list1 = ['barack', 'obar?ma', '?america?', 'war', 'russia?', 'mak?er']
common = set.intersection(*map(set,list1))
new_list = list(common)
for i in list1:
for a in new_list:
if a in i:
x = new_list.count(a)
print([i] + [a])
print(x)