(Very Newbie) Problems defining a variable

Tim Rowe digitig at gmail.com
Fri Dec 12 14:04:54 EST 2008


2008/12/12 Kirk Strauser <kirk at 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



More information about the Python-list mailing list