![Python Data Structures and Algorithms](https://wfqqreader-1252317822.image.myqcloud.com/cover/153/36701153/b_36701153.jpg)
上QQ阅读APP看书,第一时间看更新
Membership, identity, and logical operations
Membership operators (in, not in) test for variables in sequences, such as lists or strings do what you would expect, x in y returns True if a variable x is found in y. The is operator compares object identity. For example, the following snippet shows contrast equivalence with object identity:
![](https://epubservercos.yuewen.com/CC12CE/19470408801644306/epubprivate/OEBPS/Images/256c6c6d-7930-4249-b954-b16ec8bd45bf.png?sign=1738882766-vRCrofwpmXrEt8QbD0MRBPQVO7I7TMmw-0-549f899d0d8a29f7b46a107ca2ab6f26)