In Python, you cannot access set items by index or key.
But, you can check whether a specific item is present or not in the set using the in
keyword.
colors_list = ["Red", "Blue", "Green"]
print("Red" in colors_list)
True
In the above example, we are checking whether the "Red"
color exists or not in the set using the in
keyword, so as in output, we get the boolean value True
because the "Red"
color exists in the given color set.