";require "../templates/head_jq_bs4.php";echo "
";$img_path="..";require "templates/top_bs4.php"; echo "x in my_iterable my_iterable : iterable input.x not in my_iterable my_iterable : iterable input.my_list=[3,4,5,8,3]if(5 in my_list): print("Yes it is Present")else: print("NO it is NOT Present") Output Yes it is Present Example: my_list=[3,4,5,8,3]if(9 in my_list): print("Yes it is Present")else: print("NO it is NOT Present") Output NO it is NOT Present my_list=[3,4,5,8,3]if(9 not in my_list): print("Yes it is NOT Present")else: print("NO it is Present") Output Yes it is NOT Present for i in range (0,5): print(i,end=',') Output 0,1,2,3,4,
url='plus2net.com'if( '2' in url): print("yes 2 is available inside")else: print("No 2 is not available inside ") Output yes 2 is available inside
We will use Dictionarymy_dict={0:'A',1:'B'}print(1 in my_dict) # Truemy_dict={0:'A',1:'B'}print('A' in my_dict) # Falsemy_dict={'A':'X','B':'Y','C':'Z'}print('X' in my_dict) # Falseprint('C' in my_dict) # Trueprint('Y' not in my_dict) # True
We will use tuplemy_tuple=(6,1,12,7)print(7 in my_tuple) # Truemy_tuple=(6,1,12,7)print(8 not in my_tuple) # True