beginner's python help

Chris Rebert clp2 at
Sun Sep 6 09:50:37 CEST 2009

On Sun, Sep 6, 2009 at 12:46 AM, hrishy<hrishys at> wrote:
> Hi Chris
> What if i want to log that bad data and continue processing is there a way to do that ?

Tighten the area included in the try...except:

sum = 0
for item in readData:
        sum += int(item)
    except ValueError:
        print "Oops!  That was no valid number. Instead it was:", item

Also, in the future, please avoid top-posting


More information about the Python-list mailing list