Which of the following methods is used to remove an element from a set without raising an error if the element is not present?
Correct answer
C. discard()
16 views
C. discard()
16 views
The discard() method removes an element from a set if it is present, without raising an error if the element is not found.
Not sure why the answer is C? Ask here and get an explanation.