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

>>> n = 10

>>> n

10

>>> type(n)

<type 'int'>

>>> n = str(n)

>>> n

'10'

>>> type(n)

<type 'str'>

>>> n = 10.0

>>> type(n)

<type 'float'>

>>> n = 10.5

>>> type(n)

<type 'float'>

>>> n = int(n)

>>> n

10

>>> type(n)

<type 'int'>

>>> n = "hello"

>>> int(n)

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

ValueError: invalid literal for int() with base 10: 'hello'

>>>