How might I add check to see if a key already exists, and if does, increment the value, and if it doesn't exist, then set the initial value?
Something like this pseudo-code:
var dict = {};
var new_item = "Bill"
If new_item not in dict:
dict[new_item] = 1
else:
dict[new_item] += 1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…