Data Types in Python
The data types can be classified into two categories:
The major data types out of these are string, numeric, list, tuple, dictionary, set and boolean.
A. Python built-in data types
B. User defined data types.
Built-in data types in python can be classified be various categories:
| Text Type: | str |
| Numeric Types: | int, float,
complex |
| Sequence Types: | list, tuple,
range |
| Mapping Type: | dict |
| Set Types: | set, frozenset |
| Boolean Type: | bool |
| Binary Types: | bytes, bytearray,
memoryview |
The major data types out of these are string, numeric, list, tuple, dictionary, set and boolean.
We can get the data type of any object by using the type() function.
Comments
Post a Comment