Python-Quizzes | Python Sets Quiz | Question 4

Last Updated :
Discuss
Comments

What is the output of the following program?

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

{1, 2, 3, 4}

{1, 2, 3}

Invalid Syntax

None

Share your thoughts in the comments