maybe this would be of help https://stackoverflow.com/questions/455612/python-limiting-floats-to-two-decimal-points
On Fri, Jan 24, 2014 at 5:57 PM, Leon S <imthereall...@gmail.com> wrote: > Here is what I'm trying to do, accept a price of gas, but I want to add > the .009 to the price, so that people do not have to type the full amount. > Example, 3.49 /gallon would return 3.499 /gallon. > > This is what I have tried and the results of it. > > def gas_price(price): > price == raw_input("What is the price of gas?") return price + .09 > 3.49=> 3.4899999999999998 > > > It reduces the number and then adds many decimal points after. > > > Thanks for any help, I am sure this is an easy one for someone. > > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > > -- %>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor