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
Answer:D
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