gs gs109 Python Modules - Python Random Module - Quiz No.3
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 5 multiple choice questions (MCQs) to prepare and belongs to topic Python Modules. 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: Which of the following will not be returned by random.choice(“1 ,”)?
1
(space)
,
none of the mentioned
Question 2: Which of the following will never be displayed on executing print(random.choice({0: 1, 2: 3}))?
0
1
KeyError: 1
none of the mentioned
Question 3: What does random.shuffle(x) do when x = [1, 2, 3]?
error
do nothing, it is a placeholder for a function that is yet to be implemented
shuffle the elements of the list in-place
none of the mentioned
Question 4: Which type of elements are accepted by random.shuffle()?
strings
lists
tuples
integers
Question 5: What is the range of values that random.random() can return?
[0.0, 1.0]
(0.0, 1.0]
(0.0, 1.0)
[0.0, 1.0)