On 6/17/2017 1:04 AM, mc...@hotmail.com wrote:
I assigned the optimal time of 960min to x.
x=960.0
Then I assigned the time used 189min to y.
y=189.0
Then I divide the time used(y) by the optimal time(x) and multiply the answer
by 100 and assign the answer to z.
z=(y/x)*100
The answer.
z
19.6875
For Python to give you an accurate answer you must include decimal points.
I hope this helps.
In Python 3, they do not matter here.
>>> (189/960)*100
19.6875
In 2.7:
>>> (189/960)*100
0
>>> from __future__ import division
>>> (189/960)*100
19.6875
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list