Use for
loop statement to iterate the set items in python.
colors_set = {"Red", "Blue", "Green"}
for color in colors_set:
print(color)
Red
Blue
Green
In the above example, we are iterating the colors_set
by using the for
loop statement and printing the items from the set.