Python language type
Python is a strongly typed dynamic scripting language.
Strong type: adding different types is not allowed
Dynamic: Do not use the display data type declaration, and determine the type of a variable when it is assigned a value for the first time
Script Language: it is also an interpreted language. To run code, you only need one interpreter and do not need to compile it.
Strong and weak languages
1. Strong language: language that forces data type definition. Two variables of different types cannot operate on each other before forced type conversion is not performed. A strong type definition language is a type-safe language, such as Java, C #, and python. For example, "int I = 0.0;" in Java cannot be compiled;
2. Weak language: language in which data types can be ignored. In contrast to a strong language, a variable can assign values of different data types, allowing a piece of memory to be considered as multiple types, such as directly adding Integer Variables to character variables. C/C ++ and PHP are both weak languages. For example, in C ++, "int I = 0.0;" can be compiled and run.
Static and Dynamic Language
Static and Dynamic are for the Data Types of variables. The differences are as follows:
1. In code written in a static type language, the Data Type of the variable must be declared, and variables of different data types cannot be directly assigned values. The data type of the variable is checked during compilation.
2. Before using variables, the static language must allocate memory for them.
3. Static language has powerful functions, but is relatively difficult to learn and has poor flexibility.
4. The dynamic type language is the opposite of the static language. It checks the data type only during the running of the program, and does not need to specify the data type for the variable. When it first gives the variable to colleagues, record Data Types internally.
5. Although the dynamic type language is fast and flexible, it is difficult to find bugs before the code runs. Therefore, the development speed is improved, but the robustness of the program is lost.
1) Static language: c, c ++, c #, object-c, Java, etc.
2) Dynamic Language: Python, ruby, PHP, JavaScript, erlang, etc.