1. Version differences
Python code--bytecode--machine--Computer
PyPy code-to-machine code--Computer
CPython is the official version of Python
#!/usr/bin/env python
#-*-Coding:utf-8-*-
The. pyc file is a byte-code file, which is equivalent to a caching mechanism
2. Variables
1. A variable refers to something
2. Composed of numbers, underscores, letters (note: Cannot start with a number)
3. Cycle
1.if, after else,elif2017-07-15 condition must remember add:
2.while cyclic generation conditions will always be met. Break can force the loop to jump out, continue means exiting the loop and entering the next loop.
4. Encoding
1.UTF-8,GBK is the simplification of the universal code
2. If you want to convert Utf-8 to GBK, you need to convert to Unicode first.
If A is utf-8, convert it to GBK:
A = A.decode ('utf-8'# decoding needs to specify what type of encoding is originally a = A.encode ('GBK ') # encoding needs to specify what type of encoding you want to turn into
Python variable, code base day-1