As we know that, in python 2.x, if we divide two integer values it results in an int
. However, if using from __future__ import division
, we instead get a float
value.
>>> 3/2
1
>>> from __future__ import division
>>> 3/2
1.5
>>>
>>>
>>> 3//2
1
>>> 4/3
1.3333333333333333
>>>
So, //
instead of /
should be used if we want integers after importing __future__.division
, but I want to know how to make /
to return integers again.
Is there any way to un-import or remove the previously imported module?
There is a method to unimport libs or Modules in IDLE, that is to Restart it by using Ctrl+F6 or Options in Menu