Â
In this we are going to see a basic program which adds elements in sets in Python Programming Language.
set1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
print("Set : ", set1)
# For Adding Single Element
set1.add(11)
print("-------------------------------------")
print("After Single Element Adding The Set Is : ", set1)
# For Adding Multiple Elements
set1.update([12, 13, 14, 15])
print("-------------------------------------")
print("After Multiple Elements Adding The Set Is : ", set1)
# Coded By DHIRAJ SHELKE
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP