Random-Function-Unveiling-the-Power-of-Randomness-in-Programming.ppt
Random-Function-Unveiling-the-Power-of-Randomness-in-Programming.ppt
Produces random numbers or values. Offers different functions for specific use cases.
The Random Module in
Python
To use random functions in Python, import the random
module:
Overview of Random Functions
Function Description Example
Cryptography Testing
Random key generation Generating random test
for secure data for software
communication. validation.
Example Program
(A) (B)
Any integer between 0 and 5. Any integer between 1 and 4.
(C) (D)
Any integer between 1 and 5. Any integer between 0 and 4.
(C) (D)
uniform(a, b) shuffle()
(C) (D)
Rearrange the list in random order. Remove duplicates from the list
(C) (D)
A random float between 1 and 10. A random integer between 1 and 10.