For Python, is the is & amp; quot; // & amp; quot; statement True after a is & amp; quot; // & amp; quot?

Source: Internet
Author: User

For Python, is the is & quot; // & quot; statement True after a = & quot;/& quot?

These two days, when I wrote LCS, I found that

Vc + keys + C1yKOuyOe5 + keys/HU8re1u9hGYWxzZS48L3A + Cgo8cD48aW1nIHNyYz0 = "http://www.2cto.com/uploadfile/Collfiles/20150211/20150211085719250.png" alt = "here write picture description" title = "\">

Note that when the variable determines whether it is equal to a constant in the future, if it is used, it may always be False.

However,

A = "+ "? A is "+"
A = "\\"? A is "\\"

The bool values of the following statement are different. The former is true, and the latter is false...

Thanks @ Kaixuan chongfeng for explaining the blog post in this blog. link. But I still don't understand it...
Http://guilload.com/python-string-interning/
It may be related to escape characters.









Related Article

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.