Articles → Python → Check if the value exists in the list using in operator

Check if the value exists in the list using in operator






Example




list = [1,2,3]

print(11 in list)




list = [1,2,3]

print(2 in list)



Not in operator






list = [1,2,3]

print(2 not in list)





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Thursday, March 14, 2019
 
Updated On  -  Thursday, May 02, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250