Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How to Remove Items in a Set in Python Using the discard() Method

nameSet = {"John", "Jane", "Doe"}

nameSet.discard("John")

print(nameSet)
# {'Doe', 'Jane'}
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #How #Remove #Items #Set #Python #Using #Method
ADD COMMENT
Topic
Name
8+5 =