Data type is an important concept in programming. Variables can store data of different types, and different types have different purpose. Here we will discuss about Python Data Types.

In Python, data type is set when you assign a value to a variable.
Python has the following data types –
Example | Data Type |
x = 10 | int |
x = “Hello Python” | str |
x = 10.5 | float |
x = 10j | complex |
x = [“Python” , “JavaScript” , “ReactJs”] | list |
x = (“Python” , “JavaScript” , “ReactJs”) | tuple |
x = {“Python” , “JavaScript” , “ReactJs”} | set |
x = {“name” : “Max” , “age” : “20”} | dict |
x = frozenset({“Python” , “JavaScript” , “ReactJs”}) | frozenset |
x = range(5) | range |
x = True | bool |
x = b”Hello Python” | bytes |
x = bytearray(5) | bytearray |
x = memoryview(bytes(5)) | memoryview |
x = None | NoneType |
We can check data type of any value –
x = 10
print(type(x))
Result -
<class 'int'>