Sets in Python are unordered, so they do not support indexing. But we can access set items using loops or by converting to a list.
Python में sets unordered होते हैं, इसलिए आप index से सीधे access नहीं कर सकते। लेकिन आप loop या list में बदलकर items access कर सकते हैं।
my_set = {"Python", "Java", "C++"}
for item in my_set:
print(item)
if "Java" in my_set:
print("Java is in the set")
for index, value in enumerate(my_set):
print(index, value)
my_list = list(my_set)
print(my_list[0])