Dick Moores wrote: > Gotta say though, I still don't understand how the defaultdict works here.
Did you try the docs? http://docs.python.org/lib/defaultdict-objects.html If coinCount were an ordinary dict, the line coinCount[deno] += 1 would have to be written as coinCount[deno] = coinCount.get(deno, 0) + 1 Using defaultdict(int) makes the use of 0 as the default value automatic. (Actually the default value is obtained by calling int(), whose value is 0.) Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor