Python 2.7.7 |Anaconda 2.0.1 (x86_64)| (default, Jun 2 2014, 12:48:16)

Type "copyright", "credits" or "license" for more information.


IPython 2.1.0 -- An enhanced Interactive Python.

Anaconda is brought to you by Continuum Analytics.

Please check out: http://continuum.io/thanks and https://binstar.org

? -> Introduction and overview of IPython's features.

%quickref -> Quick reference.

help -> Python's own help system.

object? -> Details about 'object', use 'object??' for extra details.

%guiref -> A brief reference about the graphical user interface.


In [1]: a = 1


In [2]: type(a)

Out[2]: int


In [3]: float(a)

Out[3]: 1.0


In [4]: b = float(a)


In [5]: type(b)

Out[5]: float


In [6]: type(a)

Out[6]: int


In [7]: int(b)

Out[7]: 1


In [8]: type(int(b))

Out[8]: int


In [9]: 1/2

Out[9]: 0


In [10]: from __future__ import division


In [11]: 1/2

Out[11]: 0.5


In [12]: a / float(b)

Out[12]: 1.0


In [13]: