critique this little script, if you like

Alexis Roda arv.nntp at
Mon May 1 12:27:33 CEST 2006

John Salerno escribió:
> 2. Between the if block or the try block, which is more Pythonic? 

Since the command line argument is optional I don't think it should be 
considered and exceptional condition if it's missing, so the "if" block 
looks better to me. No idea if this is more pythonic.

 > The
 > try block seems nicer because it doesn't have such an ugly-looking check
 > to make.

Ok, so you should do:

     x = 1/i
except ZeroDivisionError :

instead of

if (i == 0) :


More information about the Python-list mailing list