怎样统计输出list1内的元素在list2内的词频?比如list1内的a,在list2里词频为2。
list1 = ['a', 'b', 'c'] list2 = ['a', 'a', 'b', 'c', 'c', 'd'] for l1 in list1: print(f'{l1}在list2中的词频为{list2.count(l1)}')