Loop Items
You can loop through the set items by using a for loop:
Example
thisset = {"apple", "banana", "cherry"}
for x in thisset:
print(x)
You can loop through the set items by using a for loop:
thisset = {"apple", "banana", "cherry"}
for x in thisset:
print(x)
Join CodingNow 2.0's Python course — live mentorship, real projects, and 100% placement support.
Enroll Now — Free Demo AvailableQuick answers about learning Loop Sets in Python.