每次调用计数函数时,我都想获得增量输出
import collections
result = collections.defaultdict(list)
global probability
def count():
vent ="Event"
if event in result:
probability +=1
else:
probability = 0
result[event] = {"Count":probability,"Event Type":"Login","Source":"Security","Message":"msg"}
print result[event]
count()
count()