1.python conditions when the IF condition is equal

Source: Internet
Author: User

When we make the IF = = judgment!
The conditions in which to judge:
1: The value is not the same
2: Whether the memory address is the same
3: Whether the type is the same
# # #三者少了任何一个都不可以

User_list = [{' Name ': ' alxe ', ' password ': 123}]current_list = {' name ': ' Alex ', ' password ': 123}if user_list[0][' name ']  = = current_list[' name ':  print (88811188)  # #不会输出print (A,b,type (a), type (b), id (a), id (b), a = = b) Test our judgment = = Condition: output: alxe Alex <class ' str ' > <class ' str ' > 10459712 18767576 false to see that its ID value is not the same as false

An example that conforms to equality

Eligible: ID is the same as >>> ' alex ' = = ' Alex ' true>>> a = ' Alex ' >>> B = ' Alex ' >>> a = = btrue>> > ID (a), id (b) (18785368, 18785368) >>>

  

1.python conditions when the IF condition is equal

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.