The Difference Between The Functions Discard And Remove Is That #539
The difference between the functions discard and remove is that:
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 Python Sets - Python Sets - Quiz No.6.
The difference between the functions discard and remove is that:
Discard removes the last element of the set whereas remove removes the first element of the set
Discard throws an error if the specified element is not present in the set whereas remove does not throw an error in case of absence of the specified element
Remove removes the last element of the set whereas discard removes the first element of the set
Remove throws an error if the specified element is not present in the set whereas discard does not throw an error in case of absence of the specified element