def count_of_a(list1): x = [] for i in list1: #loop through the elements in list1 if 'a' in i: #if a in any element in list1 sage = i.count('a') #count the number of a in that element x.append(sage) #add the count to x