xx / always truncatesalways an int result for ints in and float(zguarantees float division with remainder in either or alternativelyyou can enable division in with __future__ importrather than forcing it with float conversionsc:\codec:\python \python from __future__ import division / enable "/behavior integer /is the same in both this special from statement applies to the rest of your session when typed interactively like thisand must appear as the first executable line when used in script file (and alaswe can import from the future in pythonbut not the pastinsert something about talking to "the dochere floor versus truncation one subtletythe /operator is informally called truncating divisionbut it' more accurate to refer to it as floor division--it truncates the result down to its floorwhich means the closest whole number below the true result the net effect is to round downnot strictly truncateand this matters for negatives you can see the difference for yourself with the python math module (modules must be imported before you can use their contentsmore on this later)import math math floor( math floor(- - math trunc( math trunc(- - closest number below value truncate fractional part (toward zerowhen running division operatorsyou only really truncate for positive resultssince truncation is the same as floorfor negativesit' floor result (reallythey are both floorbut floor is the same as truncation for positiveshere' the case for xc:\codec:\python \python - ( - / /- ( - - ( - numeric types truncates to floorrounds to first lower integer becomes - becomes -