Home >Backend Development >Python Tutorial >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 number string to 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 same Variable nameAssign a value to it
##You can also use replace()function to 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!