python data types
The data type 1.python
(1) data type classification
python data types can be divided 数字型
and 非数字型
.
- Numeric
- Integer (
int
) - Float
float
( ) - Boolean
bool
( ) - Complex type (
complex
) (mainly used for scientific computing)
- Integer (
- Non-digital type
- String
- List
- Tuple
- dictionary
Note: In Python 2.x, the integer value stored depending on the length of the further divided into: int
(integer) long
(long)
(2) variable between different types of operational problems:
数字型变量
Can be calculated directly between字符串变量
Use between+
string concatenation字符串变量
And you can整数
use the*
repetition of the same splicing字符串
数字型变量
And字符串
between not be another computingThe definition and use of variables in 2.python
- Defined: python is interpreted programming language, it does not specify a data type definition of variables. Interpreter type automatic recognition data according to the value to the right of the assignment operator.
Use: In Python, each variable must be assigned before use, variable assignment after the variable will be created
Note: Use the interactive differ on the form and interpretation of the definition and use of variables.
3.python variable named
- case-sensitive identifier python
- python named variables can be used:
- Underline law
- Small hump law
- Large hump law