Python-Quizzes | Python Sets Quiz | Question 3

Last Updated :
Discuss
Comments

What is the output of the following program?

Python
set1 = {1, 2, 3} 
set2 = set1.copy() 
set2.add(4) 
print(set1) 

{1, 2, 3, 4}

{1, 2, 3}

Invalid Syntax

Error

Share your thoughts in the comments