0% found this document useful (0 votes)
11 views1 page

Py Exp 2.3

The document demonstrates basic set operations in Python, including adding and removing elements from a set. It also illustrates how to perform union and intersection of two sets. Additionally, it shows how to access the coordinates of a tuple.

Uploaded by

55- Sheldon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Py Exp 2.3

The document demonstrates basic set operations in Python, including adding and removing elements from a set. It also illustrates how to perform union and intersection of two sets. Additionally, it shows how to access the coordinates of a tuple.

Uploaded by

55- Sheldon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

#exp 2.3 and 2.

colors = {'red', 'green', 'blue'}

colors.add('yellow') print(colors)
colors.remove('green') print(colors)

print('red' in colors)

set_a = {1, 2, 3} set_b = {3, 4, 5}


print(set_a.union(set_b))
print(set_a.intersection(set_b))

point = (10, 20)

print("X coordinate:", point[0])


print("Y coordinate:", point[1])

You might also like