Question 1
What is the output of the following program?
set1 = {1, 2, 3, 4, 4}
print(set1)
{1, 2, 3}
{1, 2, 3, 4}
{1, 2, 3, 4, 4}
Error
Question 2
What is the output of the following program?
set1 = {3, 4, 5}
set1.update([1, 2, 3])
print(set1)
{1, 2, 3, 4, 5}
{3, 4, 5, 1, 2, 3}
{1, 2, 3, 3, 4, 5}
Error
Question 3
What is the output of the following program?
set1 = {1, 2, 3}
set2 = set1.copy()
set2.add(4)
print(set1)
{1, 2, 3, 4}
{1, 2, 3}
Invalid Syntax
Error
Question 4
What is the output of the following program?
set1 = {1, 2, 3}
set2 = set1.add(4)
print(set2)
{1, 2, 3, 4}
{1, 2, 3}
Invalid Syntax
None
Question 5
What is the output of the following program?
set1 = {1, 2, 3}
set2 = {4, 5, 6}
print(len(set1 + set2))
3
6
Unexpected
Error
Question 6
What is the output of the following program?
set1 = {0, 2, 4, 6, 8};
set2 = {1, 2, 3, 4, 5};
print(set1 | set2)
{0, 1, 2, 3, 4, 5}
{0, 1, 2, 3, 4, 5, 6, 8}
{ 6, 8}
None
Question 7
What is the output of the following program?
set1 = {0, 2, 4, 6, 8};
set2 = {1, 2, 3, 4, 5};
print(set1 & set2)
{0, 1, 2, 3, 4, 5, 6, 8}
{0, 1, 3, 5, 6, 8}
{2, 4}
{0, 8, 6}
Question 8
What is the output of the following program?
set1 = {0, 2, 4, 6, 8};
set2 = {1, 2, 3, 4, 5};
print(set1 - set2)
{0, 1, 2, 3, 4, 5, 6, 8}
{0, 8, 6}
{2, 4}
{0, 1, 3, 5, 6, 8}
Question 9
What is the output of the following program?
set1 = {0, 2, 4, 6, 8};
set2 = {1, 2, 3, 4, 5};
print(set1 ^ set2)
{0, 1, 2, 3, 4, 5, 6, 8}
{2, 4}
{0, 8, 6}
{0, 1, 3, 5, 6, 8}
Question 10
What is the output of the following program?
set1 = set([1, 2, 4, 4, 3, 3, 3, 6, 5])
print(set1)
{1, 2, 4, 4, 3, 3, 3, 6, 5}
{1, 2, 3, 4, 5, 6}
[1, 2, 3, 4, 5, 6]
[1, 2, 4, 4, 3, 3, 3, 6, 5]
There are 11 questions to complete.