Set in Python (सेट) :-
Set (सेट) Python का एक Built-in Data Type है, जिसका उपयोग एक या अधिक (One or More) Unique Values (अद्वितीय मान) को Store करने के लिए किया जाता है।
Set में प्रत्येक Element Unique (अद्वितीय) होता है। यदि किसी Value को एक से अधिक बार लिखा जाए, तो Set उसे केवल एक बार ही Store करता है।
Set एक Mutable (परिवर्तनीय) तथा Unordered (अक्रमबद्ध) Data Structure है। अर्थात Set में नए Elements जोड़े या हटाए जा सकते हैं, लेकिन उसके Elements का कोई निश्चित क्रम (Order) नहीं होता।
Python में Set को Curly Braces ({}) के अंदर लिखा जाता है तथा प्रत्येक Element को Comma (,) से अलग किया जाता है।
महत्वपूर्ण: Set में Duplicate Values Allowed नहीं होतीं।
English
A Set is a Built-in Data Type in Python used to store one or more unique values.
Each element in a Set is unique. If the same value is written multiple times, Python stores it only once.
A Set is a mutable and unordered data structure. This means elements can be added or removed, but they do not have a fixed order.
In Python, a Set is written inside curly braces ({}), and each element is separated by a comma (,).
Important: A Set does not allow duplicate values.
Syntax -
set_name = {item1, item2, item3}
Example -