Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add membership commands in comands topic #4551

Merged
merged 9 commits into from
May 16, 2024
5 changes: 5 additions & 0 deletions content/python/concepts/operators/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,9 @@ Python evaluates an expression in order of precedence as follows:
- `and`
- `or`

## Membership operators
avdhoottt marked this conversation as resolved.
Show resolved Hide resolved

- The `in` operator returns `True` if the element on the left is found within the iterable object on the right. Here, the element on the right side of the `in` operator must be an iterable object like a list, string, dictionary, etc.
- The `not in` operator returns `False` if the element on the left is not found within the iterable object on the right. Again, the element on the right side of the `not in` operator must be an iterable object.

**Note:** Items at the same precedence are evaluated left to right. The exception to this is exponentiation, which evaluates right to left.