Contact: aviboots(AT)netvision.net.il
39,988 questions
51,933 answers
573 users
# Create a set my_set = {1, 2, 3, 4} # Add an element to the set my_set.add(1) my_set.add(5) print(my_set) ''' run: {1, 2, 3, 4, 5} '''
# Create a set my_set = {1, 2, 3, 4} # Add an element to the set my_set.add(1) my_set.add(5) print(my_set) my_set.update([5, 6, 7]) print(my_set) ''' run: {1, 2, 3, 4, 5} {1, 2, 3, 4, 5, 6, 7} '''