标签:app print efault count 山东 上海 pen pre end
cars = ["鲁A32444","鲁B12333","京B8989M","黑C49678","黑C46555","沪B25041"]
locals = {"沪":"上海","黑":"黑龙江","鲁":"山东","鄂":"湖北","湖":"湖南"}
lst = []
dic ={}
for i in cars:
lst.append(i[0])
for j in lst:
if j in locals.keys():
dic.setdefault(locals[j],lst.count(j))
print(dic)
标签:app print efault count 山东 上海 pen pre end
原文地址:https://www.cnblogs.com/hadibingjing/p/10977439.html