Dennis Lee Bieber <wlfr...@ix.netcom.com> writes: > ... v = theDict.get(x, NOT_RELEVANT) > ... if v is not NOT_RELEVANT: > ... print x, v
I think you'd normally do this with if x in theDict: print x, v but the OP was asking about a different problem, involving looking up numeric ranges, which could conceivably be very large, thus the suggestions about interval trees and so forth. -- http://mail.python.org/mailman/listinfo/python-list