The first thing to know is that the three basic elements in Python are: ID (Identity), type (data type), and value.
= = is a comparison operator in the python operator that is used to compare the value of two objects for equality
For example:
A = ' abc '
b = ' abc '
Print a ==b >>>>true
Is is also called the identity operator, which compares the unique identities between objects, that is, whether the IDs are the same.
For example:
A = [A]
b = [[+]
Print ID (a), id (b) >>>>4389046392, 4389177464
Print A is B >>>>false
Only numeric and string Types , A is B are true, when a and B are tuple,list,dict or set type, a IS-B is false
Very no idea.
Links: https://www.jianshu.com/p/a41ad2ff2963
Source: Pinterest
The copyright of the book is owned by the author, and any form of reprint should be contacted by the author for authorization and attribution.
Python-is and = =