Quiz Yourself on Sets

Test your knowledge of sets.

Quiz

1

What will be the output of the following program?

s = {1,2,3,7,6,4}
s.discard(10)
s.remove(10)
print(s)
A)

The s.discard() method will report an error.

B)

The s.remove() method will report an error.

C)

{1, 2, 3, 4, 6, 7}

D)

None of the above

Question 1 of 80 attempted

Get hands-on with 1400+ tech skills courses.