CBSE Class 11 Computer Science Random Function MCQs

Refer to CBSE Class 11 Computer Science Random Function MCQs provided below available for download in Pdf. The MCQ Questions for Class 11 Computer Science with answers are aligned as per the latest syllabus and exam pattern suggested by CBSE, NCERT and KVS. Multiple Choice Questions for Random Function are an important part of exams for Class 11 Computer Science and if practiced properly can help you to improve your understanding and get higher marks. 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 refer to the following multiple-choice questions with answers for Random Function in Class 11.

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

MCQs for Random Function Computer Science Class 11

Expert teachers of studiestoday have referred to NCERT book for Class 11 Computer Science to develop the Computer Science Class 11 MCQs. If you download MCQs with answers for the above chapter you will get higher and better marks in Class 11 test and exams in the current year as you will be able to have stronger understanding of all concepts. Daily Multiple Choice Questions practice of Computer Science will help students to have stronger understanding of all concepts and also make them expert on all critical topics. After solving the questions given in the MCQs which have been developed as per latest books also refer to the NCERT solutions for Class 11 Computer Science. We have also provided lot of MCQ questions for Class 11 Computer Science so that you can solve questions relating to all topics given in each chapter. After solving these you should also refer to Class 11 Computer Science MCQ Test for the same chapter.

Where can I download latest CBSE MCQs for Class 11 Computer Science Random Function

You can download the CBSE MCQs for Class 11 Computer Science Random Function for latest session from StudiesToday.com

Are the Class 11 Computer Science Random Function MCQs available for the latest session

Yes, the MCQs issued by CBSE for Class 11 Computer Science Random Function have been made available here for latest academic session

Where can I find CBSE Class 11 Computer Science Random Function MCQs online?

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.

How can I prepare for Random Function Class 11 MCQs?

To prepare for Random Function MCQs, refer to the concepts links provided by our teachers and download sample papers for free.

Are there any online resources for CBSE Class 11 Computer Science Random Function?

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