How to Create a Set in Python?

preview_player
Показать описание
There are three basic alternatives to create a set:

1) ​use the constructor set([1,2,3]) and pass an iterable of the elements;
​2) use the bracket notation ‘{1,2,3}’ with the elements inside, separated by a comma; or
3) ​create an empty set and add the elements manually.

Read the full article at:

~~~
Become a better coder! Download the 5x Python Cheat Sheet Course (PDF). It’s free!

🐍 Cheating in Python? Of course! 🐍
See you soon -- it’s fun! 🤓
~~~

Experts in their fields read more books! Become a Python expert:

And become a Python master the fun way!
~~~

Start earning money by creating your own Python coding business (free webinar):
Рекомендации по теме