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
The difference between the functions discard and remove is that:
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
The difference between the functions discard and remove is that:
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!