List Functions
List methods are discussed in this articles. 1. “in” operator :- This operator is used to check if an element is present in the list or not. Returns true if element is present in list else returns false. 2. “not in” operator :- This operator is used to check if an element is not present in the list or not. Returns true if element is not present in list else returns false. # Python code to demonstrate the working of # "in" and "not in" # initializing list lis = [ 1 , 4 , 3 , 2 , 5 ] # checking if 4 is in list using "in" if 4 in lis: print ( "List is having element with value 4" ) else : print ( "List is not having element with value 4" ) # checking if 4 is not list using "not in" if 4 not in lis: print ( "List is not having element with value 4" ) else : print ( "List is having element with value ...