2008/12/12 Kirk Strauser <k...@daycos.com>:

> def get_rate(balance):
>    for threshold, rate in ((100000, .0173),
>                            (50000, .0149),
>                            (25000, .0124),
>                            (10000, .0085),
>                            (0, .006)):
>        if balance > threshold:
>            return rate
>    return .0

Yes, once it's changed from a dictionary to tuples it becomes easier,
doesn't it? D'oh!

-- 
Tim Rowe
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to