Which method is used to add an element to a set in Python?
-
A
push()
-
B
add()
Correct answer
-
C
append()
-
D
insert()
15 views
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