gs gs109 Python Sets - Python Sets - Quiz No.4
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Sets. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: What will be the output of the following Python code?
s=set() type(s)
<’set’>
<class ‘set’>
set
class set
Question 3: Set makes use of __________
Dictionary makes use of ____________
Dictionary makes use of ____________
keys, keys
key values, keys
keys, key values
key values, key values
Question 4: Which of the following lines of code will result in an error?
s={abs}
s={4, ‘abc’, (1,2)}
s={2, 2.2, 3, ‘xyz’}
s={san}
Question 5: What will be the output of the following Python code?
s={2, 5, 6, 6, 7} s
{2, 5, 7}
{2, 5, 6, 7}
{2, 5, 6, 6, 7}
Error
Question 7: Write a list comprehension for number and its cube for:
l=[1, 2, 3, 4, 5, 6, 7, 8, 9]
[x**3 for x in l]
[x^3 for x in l]
[x**3 in l]
[x^3 in l]
Question 8: What will be the output of the following Python code?
s={1, 2, 3} s.update(4) s
{1, 2, 3, 4}
{1, 2, 4, 3}
{4, 1, 2, 3}
Error
Question 9: Which of the following functions cannot be used on heterogeneous sets?
pop
remove
update
sum
Question 10: What will be the output of the following Python code?
s={4>3, 0, 3-3} all(s) any(s)
True False
False True
True True
False False