1. Home
  2. Data Science
  3. Python
  4. Which method is used to add an element to a set in Python?

Added 4 May 2024

Which method is used to add an element to a set in Python?

  1. push()
  2. add() Correct answer
  3. append()
  4. insert()

Correct answer

B. add()

15 views

MCQSEXAM

Explanation

The add() method is used to add a single element to a set in Python.

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