In this example we will show how to check if the specified item is present in the set in Python.
Source Code
my_set = {'a', 'b', 1, 2, 'c'}
if 'c' in my_set:
print("'c' is in the my_set")
Output:
'c' is in the my_set
In this example we will show how to check if the specified item is present in the set in Python.
my_set = {'a', 'b', 1, 2, 'c'}
if 'c' in my_set:
print("'c' is in the my_set")
Output:
'c' is in the my_set