a = {} source = "Linkedin" a[source ] = a.setdefault(source , 0) + 1 转载于:https://www.cnblogs.com/NachoLau/p/11395403.html