Re: [Tutor] Tutor] Careful Dictionary Building

2007-12-28 Thread Kent Johnson
doug shawhan wrote: > To help performance a bit, don't call dict.keys() on every iteration, > since you're invoking a function. > > dict = {} > allKeys =dict.Keys Should be dict.keys() > for record in list > if record[0] in allKeys: > dict[ record[0] .append(

Re: [Tutor] Tutor] Careful Dictionary Building

2007-12-28 Thread doug shawhan
Lots of very good answers to a pretty stupid question! *blush* I guess there is more than one way to do it! Uh ... guys? Did I say something wrong...? On Dec 28, 2007 12:23 PM, Tony *** <[EMAIL PROTECTED]> wrote: > Hello Doug, > > You can also use exceptions instead of the if /else. It has mo