1
我想計算總項目的列表中包含「A」的特定項目,這應該是4 + 3 = 7怎麼算的總項數的列表包含在Python
tweetword = (['a','b','c','a'],['a','e','f'],['d','g'])
count_total_a = {}
for t in tweetword:
for word in tweetword:
if word not in count_total_a:
count_toal_a[word] = len(t)
if word in count_total_a:
count_total_a[word] += len(t)
'''the result I get is not correct coz it counts the first list twice'''
真的很感謝任何幫助!