In Operator
Multiple Choice Beginner
Question
What does "a" in ["a", "b"] return?
Hint
in checks for membership.
Explanation
"a" in ["a", "b"] returns True because "a" is an element of the list. The in operator works with lists, tuples, strings, dictionaries (checks keys), and sets. For strings, "ell" in "hello" returns True (substring check). in is the membership test operator, complemented by not in.
Related Resources
Related Lessons
- Data Types
Learn Python data types.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.