"Sara Johnson" <[EMAIL PROTECTED]> wrote > However, is there an indentation error here?
Not that I can see. Is there an error? If so can you send the traceback? Its very hard to answer questions without any context. > I may just be too frustrated to see it. > > for key in skeys: > fracmiss=1.*numberMissing(z[key].values())/nsites #note > decimal multiplication, 1.* This is a mess. Why have that long comment when all that's needed is to add the zero?! (and some spaces to make it legible...) fracmiss = 1.0 * numberMissing( z[key].values() ) / nsites outstring = "%s has %4.1f%% missing" % (key, 100 * fracmiss) if fracmiss > 0.0: print outstring It looks OK apart from the poor style but I don't see anything that is an error. What are you seeing? On the style front, if you want to force a result to a float it's more conventional to use the float() conversion function: fracmiss = float( numberMissing( z[key].values() ) / nsites ) And comparing to 0.0 doesn't really add anything except two characters, it could just as well be plain old 0. if fracmiss > 0: HTH, Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor