Vidyalelo
Python · Q48

Python Sets MCQs: Exam

Programming · Python · question 48

Q48

What will be the output of the following Python code? >>> a=1,2,3 >>> b=a.copy() >>> b.add(4) >>> a

A.
{1,2,3}
Answer
B.
Error, invalid syntax for add
C.
{1,2,3,4}
D.
Error, copying of sets isn't allowed

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board