A set is a collection which is unordered and unindexed. In Python sets are written with curly brackets.
|
Note : You cannot access items in a set by referring to an index, since sets are unordered the items has no index.
You cannot access items in a set by referring to an index, since sets are unordered the items has no index. 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 list have built-in methods, methods help us to manipulate sets items.
|
Python includes many built-in methods but here we just adding some of the following built-in methods to manipulate sets :
It's a special area where you can find special questions and answers for CSE students or IT professionals. Also, In this section, we try to explain a topic in a very deep way.