Python Set


Set

A set is a collection which is unordered, unchangeable, and unindexed.

In Python sets are written with curly brackets.

Example

Create a Set:

thisset = {"apple", "banana", "cherry"}
print(thisset)
Try it Yourself »

Note: Sets are unordered, so you cannot be sure in which order the items will appear.



Copyright 1999-2023 by Refsnes Data. All Rights Reserved.