How to show percentage

dylan.moreland at gmail.com dylan.moreland at gmail.com
Thu Sep 22 20:26:15 CEST 2005


Traditionally, one part of the expression has to be a float for the
result to be a float (this is a holdover from C). So 100/3.0 will give
you the result you want. Alternatively, you can put "from __future__
import division" at the top of your script, and then 100/3 will return
a float.

http://www.python.org/doc/2.2.3/whatsnew/node7.html




More information about the Python-list mailing list