Membership Operators (in, not in) Dry Run in PYTHON

Membership Operators (in, not in) is an interactive PYTHON dry run visualizer from the Io programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Membership Operators (in, not in) Program Code

# Demonstrating membership operators
fruits = ["apple", "banana", "orange", "mango"]

print(f"Fruits list: {fruits}")
print(f"\n'banana' in fruits: {'banana' in fruits}")
print(f"'grape' in fruits: {'grape' in fruits}")
print(f"'apple' not in fruits: {'apple' not in fruits}")
print(f"'kiwi' not in fruits: {'kiwi' not in fruits}")

# String membership
text = "Hello World"
print(f"\n'H' in '{text}': {'H' in text}")
print(f"'hello' in '{text}': {'hello' in text.lower()}")

View the complete Io programs page.

Program Console Membership Operators (in, not in) Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.