10.7k views
5 votes
HELP

Which statement is true about the random and secrets modules?
O Only the secrets module can generate random numbers.
O Only the random module can generate random numbers.
O Neither module can generate random numbers.
Both modules can generate random numbers.

1 Answer

4 votes

Answer:

Both modules can generate random numbers.

Step-by-step explanation:

The random module provides a suite of functions for generating random numbers based on various probability distributions. It also includes functions for generating random numbers from a seed, which allows for reproducible sequences of random numbers.

The secrets module, on the other hand, is designed specifically for generating secure random numbers. It provides functions for generating random numbers that are suitable for use in cryptographic applications, such as generating random passwords or secret keys.

User Kalpana
by
5.6k points