Lists, tuples, dictionaries and sets are some of the most popular inbuilt data storage elements available in Python.
With this Python quiz, we will learn more about the concepts associated with Sets in python and the booleans in Python. Without wasting any further time let’s get started. All the best!
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Which of the following is true about sets in Python?
Correct
Incorrect
Question 3 of 15
3. Question
Which of the following is not correct?
Correct
Incorrect
Question 4 of 15
4. Question
Comment on the statement: Set in itself is a mutable object.
Correct
Incorrect
Question 5 of 15
5. Question
Which of the following is not a set?
Correct
Incorrect
Question 6 of 15
6. Question
Find the output of the code given below? # Code snippet Start
a = {6,12,18,24} b = {3,6,9,12,15}
print(a&b)
# Code snippet Start
Correct
Incorrect
Question 7 of 15
7. Question
Find the output of the code snippet given below? # Code snippet Start
a = {6,12,18,24} b = {3,6,9,12}
c = a&b c.add(23) c.add(46) c.add(10) c.discard(6) c.discard(23) c = c-a print(c)
# Code snippet Start
Correct
Incorrect
Question 8 of 15
8. Question
What is the output of the code given below? # Code snippet Start
a = {i**3 for i in range(1,9,2)} c = {15} for j in a: c.add(max(a)+sum(c))
print(c)
# Code snippet Start
Correct
Incorrect
Question 9 of 15
9. Question
Find the output of the code snippet given below? # Code snippet Start
a = {6,12,18,24} b = {3,6,9,12}
print(a-b)
# Code snippet Start
Correct
Incorrect
Question 10 of 15
10. Question
What will be the output of the following code snippet? # Code snippet Start
s = {‘QuizOrbit’ , 1952, (emp1,emp2,emp3)} print(type(s))
# Code snippet Start
Correct
Incorrect
Question 11 of 15
11. Question
What will be the output of the code snippet given below? # Code snippet Start
a = {2,4,6,8,10} b = {3,6,9,12,15}
print(a|b)
# Code snippet Start
Correct
Incorrect
Question 12 of 15
12. Question
Find the output of the code given below? # Code snippet Start
setVal = {} print(type(setVal))
Correct
Incorrect
Question 13 of 15
13. Question
What will be the output of the code snippet given below? # Code snippet Start
s = ‘banana’ s = list(s)
print(len(set(s)))
# Code snippet Start
Correct
Incorrect
Question 14 of 15
14. Question
What will be the output of the code snippet given below? # Code snippet Start
s = [1,2,3,4,1,2,6,7,8,9,2,3]
s = set(s) print(s[0])
# Code snippet Start
Correct
Incorrect
Question 15 of 15
15. Question
What will be the output of the following program? # Code snippet Start
s = ‘QuizOrbit’ s = list(s) s1 = set(s)
print(len(s)-len(s1))
# Code snippet Start
Correct
Incorrect
Summary
We hope you might have now got a clear picture of sets in your mind. Sets help in various data requirements and are used widely by the python community. Make sure to be thorough with the previous concepts before moving ahead. Happy Learning!
i am stupid
it is good but i got none