Python data types can be divided into three categories: numeric, sequence, and mapping. There is also the None object that represents a Null, or absence of a value. It should not be forgotten either that other objects such as classes, files, and exceptions can also properly be considered types; however, they will not be considered here.
Every value in Python has a data type. Unlike many programming languages, in Python you do not need to explicitly declare the type of a variable. Python keeps track of object types internally.
Python built-in data types are outlined in the following table:
Category |
Name |
Description |
None |
None |
The null object. |
Numeric |
int |
Integer. |
float |
Floating point number. |
|
complex |
Complex number. |
|
bool |
Boolean (True, False). |
|
Sequences |
str |
String of characters. |
list |
List of arbitrary... |