Category Archives: Python Set

Python set data type is an unordered collection of unique (non duplicates) immutable elements or items. Since set data type is immutable that means we can not change it.

Python set data type looks similar to python list or tuple data type. However the major difference between List/Tuple and Set data type is that, In list or Tuple we can have multiple occurrences of same element. Whereas in case of set data type each element is unique and we can’t have multiple occurrences of same element.

Sets in python

Introduction to sets in python: In this tutorial we are going to learn python Set data type. So let’s first start with the definition of python set data type. It is an unordered collection of unique (non duplicates) immutable elements or items. Here an individual data item of set is called as an element or an item of set. set_variable = {1,2,3} In above example numbers 1, 2, 3 are known as the elements or items of set. How to create a Set in python? There

Read More