Home>Article>Backend Development> Learning records of python strings
1,ord(), convert the characters into their corresponding ASCII codes
chr(), convert the ASCII codes into the corresponding Characters
Example: Convert a binary numberstringto the equivalent decimal number
2. String modification:
Strings are immutable and cannot be changed after they are created; if you want to modify them, you can create a new string and use the sameVariable nameAssign a value to it
##You can also use replace()functionto modify it:
The above is the detailed content of Learning records of python strings. For more information, please follow other related articles on the PHP Chinese website!