Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (15 sloc) 361 Bytes
#1
setA = set()
#2
lengthA = int(input("Enter the total elements for the set : "))
#3
for i in range(lengthA):
e = int(input("Enter value {} : ".format(i + 1)))
setA.add(e)
#4
print("setA before discard : {}".format(setA))
#5
element = int(input("Enter the element to discard : "))
#5
setA.discard(element)
print("setA after discard : {}".format(setA))
You can’t perform that action at this time.