Programming (
3011)
practical No. 8 : write p,
on Set : (a) Create oe rogram to Perform following Operations
(d) Delete Access Set Elemente) Po”
(1) Practical significance
Sets in Python provide
elimina
an efficient way to store and 1 1 i ¢
ng dapbare ay to store and manipulate unique elements, automatic
oat oa = a They support fast membership testing, making them ideal for tasks lil
: peated items and performing set operations like union, intersection, and difference
This makes sets parti 5
oan ee useful for handling collections of data where uniqueness and efficient
(11) Industry / Employer Expected Outcome
The aim of this course is to attain the following industry/employer expected outcome
through various teaching learning experiences:
Develop programs using python to solve wide-reaching electronics engineering related problems.
(111) Course Level Learning Outcome
C03- Perform operations on sequence structure
python.
(IV) Laboratory Learning Outcome
LLO 8.1 Implement various set operations.
(V)_ Relevant Affective Domain related outcome(s)
(1) Follow safety practices.
(2) Demonstrate working as a leader / a team member.
(3) Follow ethical practices.
(VI) Relevant Theoretical Background
‘A cet is an unordered collection of unique elements. This means that no element can appear more
thes cace ina set. Seta are mutable, meaning you can add or remove elements from them after they
. i. ship testit removing duplicates from a
ted ‘are particularly useful for membership testing, ig dup! mi
ete Lane reY forming, mathematical set operations like union, intersection, difference, and
symmetric difference.
1. Creating a Set
“Yih a Siete soot by Plnciag. sls the item (elements) incite curly bracce, ), separated by
commas, or by using the built-in set() function.
# Creating a set using curly braces
my_set = {1, 2,3, 4, 5)
print("Set:", my_set)
# Creating a set using the set0) function
my_set = set({1, 2, 3,4, 5)
print("Set:", my_set)
# Creating an empty set
empty_set = 90t0)
print(“Empty Set:", empty_set)
MO a ee
aharachva Slate Board of Technical Education (*¢wv aa
| Pape