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

Quiz: NumPy · Question 10 of 10

Why create random numbers with np.random.defaultrng(42)?

Why create random numbers with np.random.default_rng(42)?

  1. A.Seed 42 gives more random numbers
  2. B.The same seed gives the same numbers every run, so experiments are reproducible
  3. C.It is the only way to get integers
  4. D.It makes the numbers normally distributed
Answer & explanation

Correct answer: The same seed gives the same numbers every run, so experiments are reproducible

default_rng is also the modern replacement for np.random.seed().

Can you get the rest right without peeking?

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

Start the quiz →