1. Home
  2. Data Science
  3. Python
  4. Which of the following methods removes all elements from a…

Added 4 May 2024

Which of the following methods removes all elements from a set in Python?

  1. remove()
  2. clear() Correct answer
  3. pop()
  4. discard()

Correct answer

B. clear()

18 views

MCQSEXAM

Explanation

The clear() method removes all elements from a set.

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs