You can use a for-in loop to iterate over every item in a set. Type in and run the following code:
// Iterating over a set
for genre in movieGenres {
print(genre)
}
You should see each set item in the Debug area. Since sets are unsorted, you may get the results in a different order when you run this code again.
In the next section, you will learn about the various operations that you can do with sets in Swift.