CBSE Class 12 Computer Science Question 6 of 43

Practice Paper — Question 6

Back to all questions
6
Question

Question 6

Which of the following cannot be returned by random.randrange(4) ?

  1. 0
  2. 3
  3. 2.3
  4. None of these
Answer

2.3

Reason — The random.randrange(4) function returns a randomly selected integer from the range [0, 1, 2, 3], which includes integers only. It cannot return a floating-point number like 2.3.