The most important thing is that the string in python is an ordered character set (immutable sequence ).
1. Python has no characters and only a single character string.
2. The character string cannot be directly modified at a certain position.
3. Important operations:
S1 + S2 merge
S1 * 3 already exists
S1 [I] Index
S1 [I: J] Fragment
Len (S1) Length
For X in S1 Iteration
'M' in S1 member relationship
4. The functions of single quotes and double quotation marks are the same. Each character can be enclosed by a single quotation mark without the need to escape the character with a backslash.
5. The index is consistent with the character array in C and supports negative offset. For example, s [-2] is the second character from the right.
6. Fragment s [I: J] is the segment from I to J-1 in the S string. (I is not written as the upper bound, J is not written as the lower bound)
7. Modify characters at a certain position in a string by means of indexing, slicing, and merging.
8. String formatting is similar to printf in C.
9. reference the standard string module import string
10. Convert string. Upper (s) to uppercase
String. Find (S, "mm") returns the first character position of the indexed substring
String. atoi ("42") string to a number