Error!

Steve Holden steve at holdenweb.com
Sat Feb 5 09:56:43 EST 2005


Bruno Desthuilliers wrote:

> Steve Holden a écrit :
> (snip)
> 
>> So, for example, your program might look like this:
>>
>> base_price = int(raw_input(...))
>> tax_rate = int(raw_input(...)
>> tax_amount = base_price * ((100+tax_amount)/...)
> 
> s/(100+tax_amount)/(100 + tax_rate)/, I guess ?

Oops.

Let's try

tax_amount = base_price*(tax_rate/100.0)

Clearly I was right about simplification being a good idea :-)

regards
  Steve
-- 
Meet the Python developers and your c.l.py favorites March 23-25
Come to PyCon DC 2005                      http://www.pycon.org/
Steve Holden                           http://www.holdenweb.com/



More information about the Python-list mailing list