In this tutorial you will learn about the Python Set and its application with practical example.
Python Set
In Python, set is an unordered collection of unique elements or items. A Set is defined by comma-separated values inside braces { }.
Example:-
1 2 |
s1 = {5,2,3,1,4} print("s1 = ", s1) |
Output:-
1 |
s1 = {1, 2, 3, 4, 5} |