in — Easy Playground
Membership test operator; also used in for loops to iterate over items
Python Playground
Output
Click "Run" to execute your code'in' tests membership. For lists it checks values, for strings it checks substrings, for dicts it checks keys.
Challenge
Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?