Skip to main content

Sets

Sets are unordered collections of items that contain no duplicates.  If a duplicate entry is attempted, the entry is ignored.

# Pyhon Sets are unordered, unchageable, and do not allow duplicates

# How sets are defined
myset = {"apple", "banana", "cherry"}

# or
myset = set(("apple", "banana", "cherry"))

# Some of the methods used in other list data types are also implemented
numb = len(myset)  # result: 3