One. String:
(i) operation of a single element in a string
1. Sequence combinations of single characters (elements).
2. Sequence: The position of a single character
3. Sequence operation: Built-in function len gets length, plus position index
4. Get the elements in the string: Forward index + Reverse Index
(ii) Manipulation of multiple elements in a string: shards
1. X[i:j]: Remove the X from the offset of I, until but not including the element with an offset of J.
2. In one Shard, the left boundary defaults to 0, and the right boundary defaults to the length of the Shard sequence.
3. As a sequence, the string supports merging using the plus sign, or repeating.
(c) The built-in method of the string and the invocation of the function:
1. What methods are supported by the query string: Dir (string variable name)
Dir (s)
2. Query how these methods or functions call: Help (string variable name. Find)
Help (S.find)
3. Specific examples:
(iv) How to write various strings:
1. Backslash escape sequences represent special characters
2. Single quotation mark = double quotation mark
3. Three Quotes
(v) Pattern matching:
1. Import the RE module
。。。。。。
Two. Variable
The python variable does not need to be declared and is created when a variable is assigned to it.
We need to assign an object to a variable to be saved for later invocation
Python Learning note one--string