Skip to content

Instantly share code, notes, and snippets.

@shabbirbhimani
Created April 1, 2018 12:02
Show Gist options
  • Save shabbirbhimani/8f491c410197f30a64ff13a804aa76fd to your computer and use it in GitHub Desktop.
Save shabbirbhimani/8f491c410197f30a64ff13a804aa76fd to your computer and use it in GitHub Desktop.
Membership Operators - not in
# Declare a list list1 with value [12,23,34]
list1 = [12,23,34]
print("value os list1 is", list1)
# output: value os list1 is [12, 23, 34]
# using not in operator for 25
notInOperator = 25 not in list1
print("is 25 not in list1", notInOperator)
# output: is 25 not in list1 True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment