While Statement

Mike Kazantsev mk.fraggod at gmail.com
Sat May 23 00:15:24 EDT 2009


On Fri, 22 May 2009 21:33:05 +1000
Joel Ross <joelc at cognyx.com> wrote:

> changed it to "float(number)/total*100" and it worked thanks for all 
> your help appreciated

I believe operator.truediv function also deserves a mention here, since
line "op.truediv(number, total) * 100" somehow seem to make more sense
to me than an explicit conversion.
There's also "op.itruediv" for "number /= float(total) * 100" case.

http://docs.python.org/dev/library/operator.html

-- 
Mike Kazantsev // fraggod.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 205 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20090523/b8ef97b3/attachment-0001.sig>


More information about the Python-list mailing list