I have two variables : count, which is a number of my filtered objects, and constant value per_page. I want to divide count by per_page and get integer value but I no matter
>>> 10 / float(3) 3.3333333333333335 >>> #Or >>> 10 / 3.0 3.3333333333333335 >>> #Python make any decimal number to float >>> a = 3 >>> type(a) >>> b = 3.0 >>> type(b) >>>
The best solution maybe is to use from __future__ import division
from __future__ import division