![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=1738871027-89Z8oSnBSfPj49MmMnwZiwwQdppMuQpZ-0-82bd5558ecfd45dc0ff0cd7d9c533a89)