Q. What does the Python code: x = {1, 2, 3}; x.add(4); print(x) output?
Solution:
The add() method adds an element to a set, so {1, 2, 3} with 4 added becomes {1, 2, 3, 4}.
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.