Source Code:
(back to article)
my_list = [1, 2, 3, 4, 5] # Check if 3 is in the list if 3 in my_list: print("3 is in the list") else: print("3 is not in the list") # Check if 6 is in the list if 6 in my_list: print("6 is in the list") else: print("6 is not in the list") # Output: # 3 is in the list # 6 is not in the list
Result:
Report an issue