HackerRank Set .discard(), .remove() & .pop() solution in python | python Question Solution
.remove(x)This operation removes element from the set.If element does not exist, it raises a KeyError.The .remove(x) operation returns None.Example>>> s = set([1, 2, 3, 4, 5, 6, 7, 8, 9])>>> s.remove(5)>>> print sset([1, 2, 3, 4,…