Re: value exists (newbie question)

2006-09-19 Thread John Machin
eldorado wrote: > Hello, > > I am trying to parse some files so that if a postal code exists, but is > longer than five digits it will return me only the first five digits: > ... > for insDict in insureDict: > insDict['postalcode'] = insDict.get('postalcode')[:5] > ... > This works, except fo

Re: value exists (newbie question)

2006-09-19 Thread George Sakkis
eldorado wrote: > Hello, > > I am trying to parse some files so that if a postal code exists, but is > longer than five digits it will return me only the first five digits: > ... > for insDict in insureDict: > insDict['postalcode'] = insDict.get('postalcode')[:5] > ... > This works, except f

value exists (newbie question)

2006-09-19 Thread eldorado
Hello, I am trying to parse some files so that if a postal code exists, but is longer than five digits it will return me only the first five digits: ... for insDict in insureDict: insDict['postalcode'] = insDict.get('postalcode')[:5] ... This works, except for when I get a blank postalcod