-
Print () is a function, not a statement
-
Raw_input () input function, input()
-
Python 3 makes a clearer distinction between textual and binary data.
**1.** text is represented by Unicode and is of type STR **2.** Binary data is represented by bytes (byte packets) and is of type bytes
-
New data type Bytes, representing binary data and encoded text strings with a prefix b
-
Python3 converts bytes to STR
**1.** STR can be encoded into bytes **2.**bytes can be decode into STR
-
String formatting output mode: Added format()
-
Dict type changes
Iterkeys (), itervalues(), iteritems(), keys(), values(), items()
String encoding format:
-
**ASCII: ** The encoding method used by early computers to save English characters
-
**GB2312: ** Chinese extension to ASCII
-
**GBK/GB18030: ** includes all the content of GB2312, while adding nearly 20,000 new Chinese characters and symbols
-
**Unicode: ** includes global conformance and encoding. Each character is represented by 3 to 4 bytes, which wastes space
-
**UTF-8: ** Variable-length encoding, the most widely used Unicode implementation on the Internet, determines the character length according to the language, such as 3 bytes for a Chinese character and 1 byte for a letter. It is also the default encoding format in Linux.