Method signature
add(element_in)
Parameters
element_in : The element that is be added to the Python set object.
Method Overview
The add() method adds an element to an existing Python set object.
Example
# Example Python program that adds elements to an exisiting set
seafoodMenu = {"Salmon","White Fish","Oysters"}
# Add more elements
seafoodMenu.add("Shrimp")
seafoodMenu.add("Lobster")
# Print the set updated with new elements
print("New set after adding elements:")
print(seafoodMenu)