Home>Article>Backend Development> Learning records of python strings

Learning records of python strings

Karen Carpenter
Karen Carpenter Original
2017-03-26 17:43:29 1290browse

1,ord(), convert the characters into their corresponding ASCII codes

chr(), convert the ASCII codes into the corresponding Characters

Learning records of python strings

Example: Convert a binary numberstringto the equivalent decimal number

Learning records of python strings

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

Learning records of python strings

##You can also use replace()

functionto modify it:

Learning records of python strings

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn