[Python] 4. Data type

There are some types about data.

Roughly speaking

Data type

  • numbers type : int, long int, float, complex
  • sequence type : string, list, tuple
  • mapping type : dictionary, class instance, extended C
>>> type(‘A’)
<type ‘str’>
>>> type(6)
<type ‘int’’>
>>> type(2.8)
<type ‘float’>
>>> type(‘3+4j’)
<type ‘complex’>
>>> type([1, 2, 3, 4])
<type ‘list’>