built-in data types
In programming, data types are an important concept.
Variables can store different types of data, and different types can perform different operations.
Among these categories, Python has the following built-in data types by default:
get data type
You can get the data type of any object using the type() function:
example
Print the data type of variable x:
x = 10
print(type(x))
run instance
set data type
In Python, when you assign a value to a variable, the data type is set:
set a specific data type
If you wish to specify the data type, you can use the following constructors: