Home > Article > Backend Development > Detailed explanation of the key points of Python string summary
PythonStringThe key points are as follows:
1. Some quotation mark separated characters
You can look at the string Out is a data type of Python, a character array or a continuous character set between Python single quotes or double quotes. The most commonly used quotation marks in python are ('') and (""). The functionality of both is the same, the actual content of the string is the characters between the quotes, not the quotes themselves.
2. InseparableCharacter type
String is the only literal character sequence type. However, characters themselves are not a type, so strings are the most basic unit of character storage operations.
3. String formatting Operator (%) provides functions similar to printf()
String formatting operator provides A flexible way to create custom strings based on multiple output types, it provides an interface similar to C/C++ formatting operations.
4. Triple quotation marks
can contain special characters such as line feed, carriage return or tab key. Triple quotes are actually three single quotes (''' ''') or double quotes (""" """) on both sides
5. The original string uses its original meaning for each special character
This is very useful in defining regular expressions.
6.Python strings are not terminated by NUL or '\0'
The above is the detailed content of Detailed explanation of the key points of Python string summary. For more information, please follow other related articles on the PHP Chinese website!