Data Types in Python

The data types can be classified into two categories:
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

Popular posts from this blog

Python FAQs

File Permission Systems in Computer

How to automate boring stuff with python chapter 2: Practice Questions