Practice CBSE Class 11 Computer Science Random Function MCQs provided below. The MCQ Questions for Class 11 Random Function Computer Science with answers and follow the latest CBSE/ NCERT and KVS patterns. Refer to more Chapter-wise MCQs for CBSE Class 11 Computer Science and also download more latest study material for all subjects
MCQ for Class 11 Computer Science Random Function
Class 11 Computer Science students should review the 50 questions and answers to strengthen understanding of core concepts in Random Function
Random Function MCQ Questions Class 11 Computer Science with Answers
Question. What does the following statement do?
import random
a) Imports the random module
b) Imports a random module from a list of modules
c) Imports the random function
d) imports the directory named random
Answer : A
Question. What will be the output after the following statements?
from random import
x = [0, 2, 4, 6, 8, 10]
print(sample(x, 3))
a) A dictionary containing 3 random keys from list x
b) Three random integer values between 0 and 10
c) A list containing 3 random elements from list x
d) A tuple containing 2 random elements from list x
Answer : C
Question. What will be the output after the following statements?
import random
x = [3, 8, 6, 5, 0]
y = random.shuffle(x)
print(y)
a) A random element from the list x
b) The shuffled list x with the elements mixed up
c) None
d) A random element from the list x, excluding 3 and 0
Answer : C
Question. What will be the output after the following statements?
import random
print(random.sample(range(5, 20), 4))
a) A list of 5 unique numbers within the range of 4 to 19
b) A list of 5 unique numbers within the range of 5 to 20
c) A list of 4 unique numbers within the range of 5 to 19
d) A tuple of 4 unique numbers within the range of 5 to 19
Answer : C
Question. What is the output of the code shown below?
import random
random.choice(2,3,4)
a) An integer other than 2, 3 and 4
b) Either 2, 3 or 4
c) Error
d) 3 only
Answer : B
Question. The output of the following Python code is either 1 or 2.
import random
random.randint(1,2)
a) True
b) False
c) none
d) Error
Answer : A
Question. What will be the output after the following statements?
import random as rd
print(rd.randint(4,7))
a) A random float value between 4 and 7, including 4 and 7
b) A random float value between 4 and 7, excluding 4 and 7
c) A random integer value between 4 and 7, excluding 4 and 7
d) A random integer value between 4 and 7, including 4 and 7
Answer : D
Question. What will be the output after the following statements?
import random
x = [3, 8, 6, 5, 0]
random.shuffle(x)
print(x)
a) A random element from the list x
b) The shuffled list x with the elements mixed up
c) A random element from the list x, excluding 3 and 0
d) A random element from the list elements 3 and 0
Answer : B
Question. What will be the output after the following statements?
import random
print(random.sample(range(20), 5))
a) A list of 5 unique numbers within the range of 0 to 19
b) A list of 5 unique numbers within the range of 0 to 20
c) A list of 4 unique numbers within the range of 0 to 19
d) A tuple of 5 unique numbers within the range of 0 to 19
Answer : A
Question. To include the use of functions which are present in the random library, we must use the option:
a) import random
b) random.h
c) import.random
d) random.random
Answer : B
Question. What is the output of the function shown below if the random module has already been imported?
>>>import random
>>>random.randint(3.5,7)
a) Error
b) Any integer between 3.5 and 7, including 7
c) Any integer between 3.5 and 7, excluding 7
d) The integer closest to the mean of 3.5 and 7
Answer : B
Question. What will be the output after the following statements?
import random as rd
print(rd.random())
a) A random float value between 0 and 1
b) A random integer value between 0 and 1
c) A random float value between 0 and 10
d) A random integer value between 0 and 10
Answer : A
Question. What will be the output after the following statements?
import random
print(int(random.random()*10))
a) 10
b) A random integer number within the range of 0 to 9
c) None
d) A random floating point number within the range of 0 to 9
Answer : B
Question. What is the output of the program given below:
import random
x = random.random()
y= random.randint(0,4)
print(int(x),”:”, y+int(x))
a) 0: 0
b) 2 : 4
c) 1: 6
d) 0 : 5
Answer : A
Question. Which type of elements are accepted by random.shuffle()?
a) strings
b) Lists
c) tuples
d) integers
Answer : B
Question. Which of the following can be a possible output after the following statements?
from random import
print(sample(range(0,10), 3))
a) [4, 11, 30]
b) [3, 15, 10]
c) [1, 5, 7, 4]
d) [1, 5, 0]
Answer : D
Question. What will be the output after the following statements?
import random
print(int(random.random()*10) + 1)
a) 11
b) A random integer number within the range of 0 to 11
c) None
d) A random whole number within the range of 1 to 10
Answer : D
Question. What is the output of the function shown below (random module has already been imported)?
>>>random.choice(‘sun’)
a) sun
b) u
c) either s, u or n
d) Error
Answer : C
Question. What will be the output after the following statements?
import random
x = [3, 8, 6, 5, 0]
print(random.choice(x))
a) A random element from the list x
b) The list x
c) A random element from the list x, excluding 3 and 0
d) A random element from the list elements 3 and 0
Answer : A
Question. What will be the output after the following statements?
import random
x = [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’,
‘Saturday’, ‘Sunday’]
print(x[random.randint(0, len(x) – 1)])
a) IndexError
b) A random day from all the seven days
c) A random day from all the days except Sunday
d) A random day from all the days except Monday
Answer : D
| CBSE Class 11 Computer Science Advanced Scripting MCQs |
| CBSE Class 11 Computer Science Animation Tool MCQs Set A |
| CBSE Class 11 Computer Science Animation Tool MCQs Set B |
| CBSE Class 11 Computer Science Basic Ubuntu Linux Commands MCQs |
| CBSE Class 11 Computer Science Boolean Algebra MCQs |
| CBSE Class 9 Computer Science Computer Components MCQs Set A |
| CBSE Class 11 Computer Science Computer Hardware MCQs |
| CBSE Class 11 Computer Science Computer Organisation MCQs |
| CBSE Class 11 Computer Science Conditional Statement MCQs |
| CBSE Class 11 Computer Science Creating Animation Using Synfig MCQs |
| CBSE Class 11 Computer Science Current Trends and Technologies MCQs |
| CBSE Class 11 Computer Science Dictionary in Python MCQs |
| CBSE Class 11 Computer Science Forms and Reports MCQs |
| CBSE Class 11 Computer Science Fundamentals of Computer MCQs |
| CBSE Class 9 Computer Science Introduction to Computers MCQs Set B |
| CBSE Class 11 Computer Science Introduction To Database Management System MCQs |
| CBSE Class 11 Computer Science Introduction To Layers MCQs |
| CBSE Class 11 Computer Science Introduction To Multimedia MCQs Set A |
| CBSE Class 11 Computer Science Introduction To Multimedia MCQs Set B |
| CBSE Class 11 Computer Science List Manipulation MCQs Set A |
| CBSE Class 11 Computer Science List Manipulation MCQs Set B |
| CBSE Class 11 Computer Science List Manipulation MCQs Set C |
| CBSE Class 11 Computer Science Python Fundamentals MCQs |
| Python Variables and Data Types MCQs with Answers |
| CBSE Class 11 Computer Science Random Function MCQs |
| CBSE Class 11 Computer Science Retrieve Data Using Queries MCQs |
| CBSE Class 11 Computer Science Society Law and Ethics MCQs |
| CBSE Class 11 Computer Science Software and Operating System MCQs |
| CBSE Class 11 Computer Science String and Function MCQs |
| CBSE Class 11 Computer Science Using Pictures In Synfig MCQs |
| CBSE Class 11 Computer Science Vim Editor and Basic Scripting MCQs Set A |
| CBSE Class 11 Computer Science Vim Editor and Basic Scripting MCQs Set B |
| CBSE Class 11 Computer Science Working With Table MCQs |
Important Practice Resources for Class 11 Computer Science
MCQs for Random Function Computer Science Class 11
Students can use these MCQs for Random Function to quickly test their knowledge of the chapter. These multiple-choice questions have been designed as per the latest syllabus for Class 11 Computer Science released by CBSE. Our expert teachers suggest that you should practice daily and solving these objective questions of Random Function to understand the important concepts and better marks in your school tests.
Random Function NCERT Based Objective Questions
Our expert teachers have designed these Computer Science MCQs based on the official NCERT book for Class 11. We have identified all questions from the most important topics that are always asked in exams. After solving these, please compare your choices with our provided answers. For better understanding of Random Function, you should also refer to our NCERT solutions for Class 11 Computer Science created by our team.
Online Practice and Revision for Random Function Computer Science
To prepare for your exams you should also take the Class 11 Computer Science MCQ Test for this chapter on our website. This will help you improve your speed and accuracy and its also free for you. Regular revision of these Computer Science topics will make you an expert in all important chapters of your course.
You can download the CBSE MCQs for Class 11 Computer Science Random Function for latest session from StudiesToday.com
Yes, the MCQs issued by CBSE for Class 11 Computer Science Random Function have been made available here for latest academic session
You can find CBSE Class 11 Computer Science Random Function MCQs on educational websites like studiestoday.com, online tutoring platforms, and in sample question papers provided on this website.
To prepare for Random Function MCQs, refer to the concepts links provided by our teachers and download sample papers for free.
Yes, there are many online resources that we have provided on studiestoday.com available such as practice worksheets, question papers, and online tests for learning MCQs for Class 11 Computer Science Random Function
