Python Programming Tutorial: 02 Basic data types
Variables do not need to be declared
Python variables do not need to be declared, you can type directly:
Then your memory will have a variable a, its value is 20, its type is integer (integer). Before you do not need to do any special statement, and the data type is Python automatically determined.
Then there will be the following output:
Here, we learned a built-in function type () to query the type of the variable.
Recall variable name
If you want a to store different data, you do not need to delete the original variable can be directly assigned.
There will be the following output