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/
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to