- Learn Python in 7 Days
- Mohit Bhaskar N. Das
- 67字
- 2021-07-09 20:40:27
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.
推薦閱讀
- Raspberry Pi for Python Programmers Cookbook(Second Edition)
- The Supervised Learning Workshop
- Hands-On Machine Learning with scikit:learn and Scientific Python Toolkits
- MySQL數據庫應用與管理 第2版
- Instant Apache Stanbol
- Go語言高效編程:原理、可觀測性與優化
- Mastering PHP Design Patterns
- 重學Java設計模式
- 精通Python自然語言處理
- Instant Ext.NET Application Development
- The DevOps 2.5 Toolkit
- Python Programming for Arduino
- Docker:容器與容器云(第2版)
- Node.js 6.x Blueprints
- 軟硬件綜合系統軟件需求建模及可靠性綜合試驗、分析、評價技術