QUESTION IMAGE
Question
what function in the secrets module can generate random integers between one and 15, including the possibility both one and 15?
secrets.randbelow(15)
secrets.random(16)
secrets.randbelow(16)
secrets.random(15)
The secrets.randbelow(n) function generates a random integer in the range [0, n - 1]. To get a number in the range [1, 15], we need secrets.randbelow(16) as it will generate a number from 0 to 15 and we can map it to the desired range. There is no secrets.random() function in the secrets module in Python.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
secrets.randbelow(16)