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

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.

主站蜘蛛池模板: 迁西县| 黄骅市| 攀枝花市| 清原| 琼中| 兴业县| 白水县| 昂仁县| 行唐县| 贵定县| 武乡县| 达拉特旗| 柘城县| 天长市| 吉林市| 佛冈县| 象山县| 简阳市| 开原市| 阳江市| 伊通| 侯马市| 天台县| 双流县| 金塔县| 锡林浩特市| 惠东县| 广丰县| 揭阳市| 隆子县| 浦城县| 奉化市| 长海县| 浮梁县| 潞城市| 聂荣县| 辉南县| 广南县| 无棣县| 道真| 固原市|