Snippets Collections
# Python program to illustrate 
# not 'in' operator 
x = 24
y = 20
list = [10, 20, 30, 40, 50 ]; 

if ( x not in list ): 
	print("x is NOT present in given list") 
else: 
	print("x is present in given list") 

if ( y in list ): 
	print("y is present in given list") 
else: 
	print("y is NOT present in given list") 

# Python program to illustrate 
# Finding common member in list  
# using 'in' operator 
list1=[1,2,3,4,5] 
list2=[6,7,8,9] 
for item in list1: 
    if item in list2: 
        print("overlapping")       
else: 
    print("not overlapping") 
star

Fri Oct 30 2020 20:24:21 GMT+0000 (UTC) https://www.geeksforgeeks.org/python-membership-identity-operators-not-not/

#python #is #not #in
star

Fri Oct 30 2020 20:19:26 GMT+0000 (UTC) https://www.geeksforgeeks.org/python-membership-identity-operators-not-not/

#python #in #list

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension