Python - Sets

page 1 out of 4

page 1 out of 4



Question 2     

 What are the mathematical operations supported by sets?







Question 3     

 To create an empty set which of the following syntax is correct?






Question 4     

 Which of the following is not the correct syntax for creating a set?






Question 5     

What will be the output of the following Python code?

nums = set([1,1,2,3,3,3,4,4])
print(len(nums))





Question 6     

What is the expected output for the below snippet?

Colors = {“Orange”, “Yellow”, “Red”, ”Blue”, “Yellow”, “Orange”, “Yellow”, “Red”}
print(Colors)





Question 7     

What is the expected output for the below snippet?

Colors = {“Orange”, “Yellow”, “Red”,” Blue”, “Yellow”, “Orange”, “Yellow”, “Red”}
print('orange' in Colors)







Question 9     

What is the expected output for the below snippet?

A = set(“Theinquisitive”)
B=set(“InQuiitive”)
print(A - B)






Question 10     

What is the expected output for the below snippet?

A = set(“Theinquisitive”)
B=set(“InQuiitive”)
print(A + B)





page 1 out of 4

page 1 out of 4


Sign Up Page

Oops!!

To view the solution need to Login



Score : 0 / 0
L
o
a
d
i
n
g
.
.
.