官术网_书友最值得收藏!

Membership operators

Python has two membership operators to test the membership in a sequence, such as a string, list, tuple, and others:

The following screenshot will make it clearer for you:

In the preceding screenshot, we try to search for the character, 'o', in the string, 'John', and it returns True. However, 'k' is not present in the string, and hence, it returns False.

主站蜘蛛池模板: 龙游县| 偃师市| 东乡县| 萍乡市| 长春市| 临江市| 略阳县| 修武县| 交口县| 华阴市| 安化县| 清原| 苍梧县| 调兵山市| 扶沟县| 固安县| 高要市| 和龙市| 清水县| 茶陵县| 麟游县| 德化县| 辽源市| 海宁市| 灵川县| 昭苏县| 宣武区| 新绛县| 探索| 新竹县| 疏勒县| 于田县| 河北省| 巴马| 越西县| 古丈县| 耒阳市| 雷州市| 沂南县| 霞浦县| 右玉县|