Python Learning Day6

Source: Internet
Author: User

is compare memory addresses for equality

is mainly to determine whether the value of 2 variables points to the same memory address, if so, returns True, otherwise false.

 is Bfalse # A and B each open an address in memory to hold its value, although their value is the same, but the memory address is different 1925864837008>>> ID (b) is btrue >>> ID (a)# Here you can see that the values of the two variables point to a memory address, in the Python interpreter, in order to save memory, characters and numbers have a small data pool within a certain range, Data in this fan points to the same memory address, lists, dictionaries, tuples, collections, etc. no small data pool >>> ID (b)1880121952>>>
ID memory address
>>> a = 321>>> B = 456>>> ID (a)1801244593360>>> ID (b) 1801244593392

Python Learning Day6

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.