set week 1

# Program to demonstrate Set in Python


print("=== Set ===")


# Creating a set (duplicates automatically removed)

numbers = {1, 2, 3, 3, 4}


print("Set (duplicates removed):", numbers)


# Add element to set

numbers.add(5)

print("After adding 5:", numbers)


# Remove element from set

numbers.discard(2)

print("After discarding 2:", numbers)

Comments

Popular posts from this blog

college

company

company database