一个列表中存储了一些高校的类型,请使用循环(不能使用列表的count方法)统计其中各种类型的数量
a = ['综合', '政法', '理工', '师范', '军事', '农林', '民族', '综合', '理工', '理工', '师范', '政法', '理工', '综合', '政法', '理工']
一个列表中存储了一些高校的类型,请使用循环(不能使用列表的count方法)统计其中各种类型的数量
a = ['综合', '政法', '理工', '师范', '军事', '农林', '民族', '综合', '理工', '理工', '师范', '政法', '理工', '综合', '政法', '理工']
a = ['综合', '政法', '理工', '师范', '军事', '农林', '民族', '综合', '理工', '理工', '师范', '政法', '理工', '综合', '政法', '理工']
dict1={}
for i in a:
dict1[i]=dict1.get(i,0)+1
print(dict1)