Apr-22-2017, 05:44 PM
for item in dragonLoot: stuff[item] = stuff.get(item, 0) + 1This works better with a defaultdict, then you can just add one to the key directly, without having to do the get with a default value of zero.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures