🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Modules and Libraries: all 14 questions

Quiz: Modules and Libraries · Question 12 of 14

Why do programs call random.seed(1) while testing?

Why do programs call random.seed(1) while testing?

  1. A.To make the numbers more random
  2. B.To get the same "random" numbers on every run
  3. C.To install the random module
  4. D.To pick numbers only from 1 upward
Answer & explanation

Correct answer: To get the same "random" numbers on every run

A fixed seed makes results repeatable, which helps when checking output.

Can you get the rest right without peeking?

Take the timed Quiz: Modules and Libraries quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →