Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python set

# A set contains unique elements of which the order is not important
s = set()
s.add(1)
s.add(2)
s.remove(1)
print(s)
# Can also be created from a list (or some other data structures)
num_list = [1,2,3]
set_from_list = set(num_list)
 
PREVIOUS NEXT
Tagged: #python #set
ADD COMMENT
Topic
Name
1+4 =