Even though sets are unordered and unindexed, one can still iterate through all elements using loops.
Python
fruits = {"apple", "banana", "mango"} for item in fruits: print(item) #output apple banana mango 2. Loop using Enumerate :
Python
colors = {"red", "green", "blue"} for i, value in enumerate(colors): print(i, value)