Python Programming - Data Types - Discussion

Discussion Forum : Data Types - General Questions (Q.No. 59)
59.
What is the output of the following code snippet?
my_set = {1, 2, 3, 4, 5}
result = my_set.discard(3)
print(result)
{1, 2, 3, 5}
{1, 2, 4, 5}
None
Error
Answer: Option
Explanation:
The discard() method removes the specified element from the set but does not return a value (None).
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.