Quiz on Python Set Copy Method



1. What does the copy() method do in Python sets?
2. Which of the following syntax is correct to use the copy() method for a set?
3. What will be the output of the following code: s1 = {1, 2, 3}; s2 = s1.copy(); print(s2)?
4. If you modify the original set after copying, what happens to the copied set?
5. Can the copy() method be used on other data types in Python?

Advertisements