programming-examples/python/Sets/Python program to remove an item from a set if it is present in the set.py
2019-11-15 12:59:38 +01:00

5 lines
117 B
Python

#Create a new set
num_set = set([0, 1, 2, 3, 4, 5])
#Discard number 4
num_set.discard(4)
print(num_set)