Python study concluded __Day1

A, Python is a type of what language

1, interpreted: while compiling side execution, disadvantage is running slow, but through the use of PyPy interactive interpreter (JIT technology) will make a lot of fast execution python program. Advantage is portability.

2, strong type: the type of security type. Except through cast, otherwise the variable type will not change.

3, dynamic type: variable type depending on the assigned value, does not require variable data type defined in advance

Two, Python's strengths and weaknesses

worry:

1, portability, if not used with the operating system strong ties to third-party libraries, you can seamlessly run on different operating systems, you do not need to change any code

2, has a wealth of third-party libraries, and its rich functionality

3, code forces the indenting structure leads to clear, readable

lack:

1, runs slowly

2, because it is a scripting language, can not be encrypted source code execution. (PS: the need for confidentiality part of the available written in C or C ++)

3, a plurality of threads can cpu, i.e. polynuclear invalid

Third, the difference Python2.x and Python3.x

1, Python3 defaults utf-8 encoding format, may be identified characters

2, there are some grammar Python3 optimized: input changes: Example 1

Four, Python basic grammar

1, variables: variable points question: name = name2, wherein the name is not point to point name2 name2 memory but directly to the corresponding memory, so that when changing name2 time, does not change name

2、input、print

3, splice string: + number placeholder, the format (plus parameter named variable assignment, the numerical parameters plus variable assignment order)

4, while circulating -else

5, for circulation -else

6、if-elif-else

7, strong type conversion (PS: input string is the default result)

8, linux soft link problem, the original python rm out to achieve new soft connected by ln -ls.

Guess you like

Origin www.cnblogs.com/TheFlash-Bar/p/10935048.html