How to show percentage

dylan.moreland at dylan.moreland at
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.

More information about the Python-list mailing list