• Q & A – Python Set

    Q & A – Python Set

    (1) What Is A Set Data Structure? A Set is an unordered collection data type that is iterable, mutable and has no duplicate elements.  Set is represented by { } (values enclosed in curly braces) The major advantage of using a set, as opposed to a list, is that it has a highly optimized method for checking whether a specific element is contained in the set.  This is based on a data structure known as a hash table. Since sets are unordered, we cannot access items using indexes as we do in lists. Example-1 st = {1,4,2,5,1,3,3,4} print(st) {1, 2, 3, 4,

    Read More