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

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.

主站蜘蛛池模板: 香港 | 荣成市| 黑山县| 宜兰市| 洛宁县| 金阳县| 桃园县| 克拉玛依市| 西丰县| 崇仁县| 周口市| 古丈县| 天气| 二连浩特市| 宁津县| 福州市| 永兴县| 桃源县| 上蔡县| 万年县| 白城市| SHOW| 东乌| 南木林县| 东莞市| 新乡市| 平阳县| 桐柏县| 泰来县| 昔阳县| 务川| 双鸭山市| 赤水市| 韶山市| 桐乡市| 浪卡子县| 扬州市| 日土县| 五河县| 沁水县| 连江县|