- 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.
推薦閱讀
- Spring 5.0 By Example
- Learning Cython Programming
- vSphere High Performance Cookbook
- JavaFX Essentials
- 精通Python自動化編程
- 零基礎入門學習Python(第2版)
- Service Mesh實戰:基于Linkerd和Kubernetes的微服務實踐
- 深度學習原理與PyTorch實戰(第2版)
- C++ System Programming Cookbook
- Getting Started with Hazelcast
- C#編程魔法書
- Practical XMPP
- Lucene 4 Cookbook
- Web測試囧事
- Cadence Concept-HDL & Allegro原理圖與電路板設計(第2版)