统计车辆信息
Posted hadibingjing
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了统计车辆信息相关的知识,希望对你有一定的参考价值。
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)
以上是关于统计车辆信息的主要内容,如果未能解决你的问题,请参考以下文章