Google News
logo
Python Program to Add multiple items to a set
In the following example of Python program to add multiple items to a set :
Program :
# create a set
my_set = {1, 2, 3}

# add multiple items to the set
my_set.update([4, 5, 6])

# print the updated set
print(my_set)
Output :
{1, 2, 3, 4, 5, 6}