The difference between the functions discard and remove is that:
A. Discard removes the last element of the set whereas remove removes the first element of the set
B. 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
C. Remove removes the last element of the set whereas discard removes the first element of the set
D. 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
Correct Answer: D
Explanation: The function remove removes the element if it is present in the set. If the element is not present, it throws an error. The function discard removes the element if it is present in the set. If the element is not present, no action is performed (Error is not thrown).