(Very Newbie) Problems defining a variable

Kirk Strauser kirk at daycos.com
Fri Dec 12 14:58:02 EST 2008


At 2008-12-12T19:20:52Z, John Machin <sjmachin at lexicon.net> writes:

> (1) you meant "if balance > threshold:"

balance >= threshold.  We both mistyped.  :-)

> (2) sequential search can be very fast if the sequence is in
> descending order of probability of occurence ... you might like to
> consider reversing the order

Actually, I just wanted to point out a simplified version of the exact same
algorithm.  Given enough RAM and if the speed was indeed critical, you could
turn that into a tuple of interest rates and jump straight to rate[balance]
in O(1).
-- 
Kirk Strauser
The Day Companies



More information about the Python-list mailing list