Experience at the beginning of a blog ----- first understanding of python and first experience ----- python
--- Restore content start ---
1. Differences between python2.x and python3.x
(1) The default ASSIC code is used for 2.x. Chinese characters are not supported.
(2) The default encoding of 3.x is UNICODE and supports Chinese characters.
(3) versions 2.x and 3.x are incompatible.
(4) the syntax of 3.x is more advanced and easier to learn.
2.32bits system and64bits System
The maximum memory size is different. (here we can see that the memory size is different from the storage size. Previously, it was easy for me to mix it up. Here, the memory runs while the storage size is hard disk.) For example, the 32-bit system only supports 4 GB of memory, the system must occupy some of the memory, and the remaining memory is reserved for the remaining software. The 64-bit system supports 2 ** 4x, about 16 TB.
If the computer memory is 4 GB, which of the 32-bit and 64-bit systems is faster?
A: Actually, they are the same.
3. Environment Variables
(1) organic computer (my computer), click Properties, as shown in (win10 Interface)
(2) Click the arrow to show the environment variables.
(3) Find the Path in the system variable, add the absolute Path of the file in it, and then you can directly use this command in the dos window.
4. character encoding
(1). ASSIC does not support Chinese characters. A total of 255 characters
(2). GB2312, which contains more than 6700 Chinese characters. The first character encoding table that supports Chinese characters (released in 1980)
(3). gbk1.0 contains about 20000 Chinese characters (1995)
(4) unicode universal code, a character encoding table that supports English characters and Chinese character encoding, both Chinese and English characters must occupy two bytes (16 characters), followed by the birth of the UTF-8
In the UTF-8, an English character occupies 1 byte and a Chinese character occupies 3 bytes.
Assic --> Gb2312-> gbk1.0 --> gb18030
Assic --> unicode --> UTF-8/UTF-16
5. Variable re-assignment
1 neme1 = 'Jack'2 3 name2 = name14 5 print(name1,name2)6 7 name1 = 'Mary'8 9 print(name1,name2)
Output result:
'Jack','Jack''Mary','Jack'
Next, let's look at an example:
1 a = [1,2,3,4] 2 b = a 3 4 print(a) 5 print(b) 6 7 del a[0] 8 9 print(a)10 print(b)
Output result:
[1,2,3,4][1,2,3,4][2,3,4][2,3,4]
Note: why are the results different when the original variable is changed? The first one is to change the point of the variable. The two variables point to different values, while the second one is to change. The two variables still point to the same value, so modify one of them, the other value will certainly change.
# I wrote a blog for the first time today, but it is not well written. I will continue to work hard in the future.