Close

Python – Data Types

Python comes with the following built-in data types:

 

  1. integer
  2. floating points
  3. null object
  4. boolean (true/false)

You can find the type of variable using the "type()" builtin function:

[python]
=>=>=> x = 10
=>=>=> type(x)
<class 'int'=>
=>=>=> y = 10.2345
=>=>=> type(y)
<class 'float'=>
=>=>=> z = "hello world"
=>=>=> type(z)
<class 'str'=>
=>=>=>
[/python]

As you can, python automatically recognised that automatically assigns a type, after it evaluates it.