2. Types of Data types

2.4. Set data type

It is a built-in data type. Python set data type is like set in mathematics. Set is an unordered collection unique elements. It is used to store and manipulate collection of data without duplications.

We can create set using curly braces ‘{ }’ or ‘set(  )’ constructor. Elements of set are separated by comma ‘,’.

 

Example:

Animals = {‘dog’,’cat’,’cow’,’tiger’,’elephant’}

 

Print(“The type of Animals”, type(Animals))

Output:

The type of Animals<class ‘set’>