Python Tutorials · Python Sets
Access Set Items
Learn all about Access Set Items in this comprehensive tutorial.
5 min read beginner
- •You cannot access items in a set by referring to an index or a key.
Access Items
You cannot access items in a set by referring to an index or a key.
But you can loop through the set items using a for loop, or ask if a specified value is present in a set, by using the in keyword.
python
python
python
Change Items
Note: Once a set is created, you cannot change its items, but you can add new items.
Module quiz
Test your knowledge on this module
2 questions