Python Basic Concepts-string

Source: Internet
Author: User

1. String

What quotation marks must be used to end a string when it starts with a quotation mark. Everything between the three quotes is the content of the string , and the corresponding single and double quotes can only create a single-line string.

2. Escape character

  \ , a single backslash at the end of the line indicates that the string continues on the next line instead of starting a new row.

3. Natural string

If you want to indicate certain strings that do not require special handling such as escape characters, then you need to specify a natural string. Natural strings are specified by prefixing the string with R or r .

4.Unicode string

  Unicode is the standard way of writing international texts. Just precede the string with the prefix u or u, and use a Unicode string when you are working with a text file. Especially when you know that this file contains non-English language

Words to write the text of the time.

Python Basic Concepts-string

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.