Python Tutorials
Basic

Data Structure and Data Types

String

List

Tuple

Set

Dictionary

Functions / Methods

Advance

Exception Handling

Python Access Set Items


Access Set Items

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.

Example
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.